A typographical logo of Contenido.

Line Through

You can use line through (strike through) to inidicate something that isn't valid, accurate or recommended anymore.

toggleLineThrough #

To make the selection of your content line through (or strike through) you can use toggleLineThrough function. You need to pass the initialStyleMap to the editor to see the result in the editor.

isLineThrough #

This function help you to find out if the current character is line through or not. The returend boolean will update on cursor moves.

Example #

An example of toggleLineThrough and isLineThrough usage:

Customization #

By default, the LINE_THROUGH key represent the line through inline style. For any reason if you need to change this key to something else, you can pass your custom key to the previous functions as the third parameter.

Also if you changed the default key for the line through inline style, you have to pass the updated version of style map to the editor. Here is an example:

Made with ❤ for a better experience

MIT © 2023 - This site does not track you.