स्ट्राइकथ्रू
टेक्स्ट को दिखाते हुए उस पर काटने की लाइन लगाएँ।
आज़माएँ
“Yurich” चुनकर काटें दबाएँ। आउटपुट में <s>Yurich</s> आता है और टेक्स्ट बना रहता है।
लाइव उदाहरण
उदाहरण का परिणाम
एडिटर में जोड़ें
Strikethrough चालू करें और चयन पर toggleStrikethrough चलाएँ।
import { EditorContent, EditorProvider, Strikethrough, useEditor, useIsActive } from 'yurich';
export function StrikethroughEditor() {
const editor = useEditor({
extensions: [Strikethrough],
initialValue: "<p>Yurich को काटकर देखें कि क्या बचता है।</p>",
});
const active = useIsActive(editor, 'toggleStrikethrough');
return (
<EditorProvider editor={editor}>
<button
type="button"
aria-pressed={active}
onMouseDown={event => event.preventDefault()}
onClick={() => editor.execute('toggleStrikethrough')}
>
काटें
</button>
<EditorContent ariaLabel="एडिटर" />
</EditorProvider>
);
}
ध्यान देने योग्य व्यवहार
शॉर्टकट Mod+Shift+S है। इनपुट का <del> आउटपुट में <s> बनता है।