Arkpad
FeaturesMarks

Strike

Strikethrough text with `toggleStrike`.

Type: Mark · Category: Marks

Strike draws a line through text to indicate deletion. Renders as <s> in HTML output.

Demo

Installation

import { Strike } from "@arkpad/extension-strike";

Commands

The extension registers three commands for managing strikethrough styling:

// Toggles strikethrough styling on and off for the active selection
editor.runCommand("toggleStrike");

// Explicitly applies strikethrough styling to the selection
editor.runCommand("setStrike");

// Explicitly removes strikethrough styling from the selection
editor.runCommand("unsetStrike");

Chaining Commands

You can chain commands to toggle strikethrough styling and immediately focus the editor:

editor.chain().focus().toggleStrike().run();

Keyboard Shortcuts

ShortcutAction
Mod-Shift-s or Mod-Shift-SToggles strikethrough styling

Markdown Input Rules

Type this pattern at both ends of a word or phrase to quickly apply a strikethrough:

  • ~~strike~~

Active State

const isActive = editor.isActive("strike");

Configuration

Options

NameTypeDefaultDescription
HTMLAttributesRecord<string, any>{}Key-value pairs of attributes to be rendered on the <s> DOM element.
Strike.configure({
  HTMLAttributes: {
    class: "custom-strike-styling",
  },
});