REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.37 KB
Close
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/@tiptap/extension-strike/src/strike.ts
Text
Base64
import { Mark, markInputRule, markPasteRule, mergeAttributes, } from '@tiptap/core' export interface StrikeOptions { /** * HTML attributes to add to the strike element. * @default {} * @example { class: 'foo' } */ HTMLAttributes: Record<string, any>, } declare module '@tiptap/core' { interface Commands<ReturnType> { strike: { /** * Set a strike mark * @example editor.commands.setStrike() */ setStrike: () => ReturnType, /** * Toggle a strike mark * @example editor.commands.toggleStrike() */ toggleStrike: () => ReturnType, /** * Unset a strike mark * @example editor.commands.unsetStrike() */ unsetStrike: () => ReturnType, } } } /** * Matches a strike to a ~~strike~~ on input. */ export const inputRegex = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/ /** * Matches a strike to a ~~strike~~ on paste. */ export const pasteRegex = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g /** * This extension allows you to create strike text. * @see https://www.tiptap.dev/api/marks/strike */ export const Strike = Mark.create<StrikeOptions>({ name: 'strike', addOptions() { return { HTMLAttributes: {}, } }, parseHTML() { return [ { tag: 's', }, { tag: 'del', }, { tag: 'strike', }, { style: 'text-decoration', consuming: false, getAttrs: style => ((style as string).includes('line-through') ? {} : false), }, ] }, renderHTML({ HTMLAttributes }) { return ['s', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0] }, addCommands() { return { setStrike: () => ({ commands }) => { return commands.setMark(this.name) }, toggleStrike: () => ({ commands }) => { return commands.toggleMark(this.name) }, unsetStrike: () => ({ commands }) => { return commands.unsetMark(this.name) }, } }, addKeyboardShortcuts() { return { 'Mod-Shift-s': () => this.editor.commands.toggleStrike(), } }, addInputRules() { return [ markInputRule({ find: inputRegex, type: this.type, }), ] }, addPasteRules() { return [ markPasteRule({ find: pasteRegex, type: this.type, }), ] }, })
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 2
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
index.ts
89 B
lrw-r--r--
2026-02-28 00:28:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
strike.ts
2.37 KB
lrw-r--r--
2026-02-28 00:28:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).