REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 916 B
Close
/home/byroehnu/.trash/node_modules11/@tiptap/core/src/pasteRules/textPasteRule.ts
Text
Base64
import { PasteRule, PasteRuleFinder } from '../PasteRule.js' /** * Build an paste rule that replaces text when the * matched text is pasted into it. * @see https://tiptap.dev/docs/editor/extensions/custom-extensions/extend-existing#paste-rules */ export function textPasteRule(config: { find: PasteRuleFinder, replace: string, }) { return new PasteRule({ find: config.find, handler: ({ state, range, match }) => { let insert = config.replace let start = range.from const end = range.to if (match[1]) { const offset = match[0].lastIndexOf(match[1]) insert += match[0].slice(offset + match[1].length) start += offset const cutOff = start - end if (cutOff > 0) { insert = match[0].slice(offset - cutOff, offset) + insert start = end } } state.tr.insertText(insert, start, end) }, }) }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
index.ts
105 B
lrw-r--r--
2026-02-28 11:47:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
markPasteRule.ts
2.13 KB
lrw-r--r--
2026-02-28 11:47:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
nodePasteRule.ts
1.36 KB
lrw-r--r--
2026-02-28 11:48:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
textPasteRule.ts
916 B
lrw-r--r--
2026-02-28 11:48:04
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).