Skip to content
FrameworkJavaScript

Strikethrough: crossed-out text in Blok

Wraps selected text in <s>. Activated with Cmd/Ctrl+Shift+S or by clicking the S button in the inline toolbar.

Import

TypeScript
import { Strikethrough } from '@bloklabs/core/tools';

Save Data

TypeScript
// A mark on a run of the block's text field:
// { "text": "world", "marks": { "strikethrough": true } }
JSON
{
  "type": "paragraph",
  "data": {
    "text": [{ "text": "Hello " }, { "text": "world", "marks": { "strikethrough": true } }]
  }
}

Usage Example

TypeScript
import { Blok } from '@bloklabs/core';
import { Strikethrough, Paragraph } from '@bloklabs/core/tools';

const editor = new Blok({
  holder: 'editor',
  tools: {
    // Paragraph is the default block and is not bundled with the core —
    // without it the editor starts with an "unsupported block" stub.
    paragraph: Paragraph,
    strikethrough: Strikethrough,
  },
});