Update main.ts

This commit is contained in:
Anastasia Fedotova 2025-03-11 11:28:37 +04:00 committed by GitHub
parent 126b42dbd8
commit 99cc316e7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -289,7 +289,8 @@ export default class HTMLCheckboxPlugin extends Plugin {
async fixCheckboxIds(editor: Editor, inCanvas?: Element | null | undefined, pasteContent?: string) {
let lastLine = editor.lastLine()
let lastLineLength = editor.getLine(lastLine).length
let editorContent = editor.getRange({line:0, ch: 0}, {line:lastLine, ch: lastLineLength})
editor.setSelection({line:0, ch: 0}, {line:lastLine, ch: lastLineLength})
let editorContent = editor.getSelection()
let re = /(id="hc-)([^"]+)(\")/g;
let cursor = editor.getCursor()