Compare commits

..

4 commits

Author SHA1 Message Date
Anastasia Fedotova
27aca112e5
Update manifest.json 2025-03-12 12:13:04 +04:00
Anastasia Fedotova
06f66b47a1
Update main.ts 2025-03-12 12:12:30 +04:00
Anastasia Fedotova
4fef99fa16
Update manifest.json 2025-03-11 12:09:58 +04:00
Anastasia Fedotova
d30599913d
Update main.ts 2025-03-11 12:09:31 +04:00
2 changed files with 5 additions and 4 deletions

View file

@ -289,16 +289,17 @@ 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 startCursor = editor.getCursor("from")
let endCursor = editor.getCursor("to")
let cursor = editor.getCursor()
editor.setSelection({line:0, ch: 0}, {line:lastLine, ch: lastLineLength})
let editorContent = editor.getSelection()
let re = /(id="hc-)([^"]+)(\")/g;
let cursor = editor.getCursor()
/* In regular notes event triggers after text already pasted, but in canvas - before text pasted, so we need to process content differently. */
/* In the paste listener we prevented paste with preventDefault(), so we need to add pasted text to content manually. */
if (inCanvas && pasteContent) {
let startCursor = editor.getCursor("from")
let endCursor = editor.getCursor("to")
let startContent = editor.getRange({line:0, ch: 0}, startCursor)
let endContent = editor.getRange(endCursor, {line:lastLine, ch: lastLineLength})
editorContent = startContent + pasteContent + endContent

View file

@ -1,7 +1,7 @@
{
"id": "html-checkboxes",
"name": "HTML checkboxes",
"version": "1.1.0",
"version": "1.1.2",
"minAppVersion": "1.1.0",
"description": "Allows to quickly add HTML checkboxes to your notes and makes them clickable.",
"author": "Anareaty",