Fix incorrect tag end position

This commit is contained in:
Peaceultime 2025-12-23 12:23:06 +01:00
parent e9ffdd58a5
commit 32b6cf4af7
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ export const tag: MarkdownConfig = {
if (cx.slice(pos, pos + 1).charCodeAt(0) !== 35 || String.fromCharCode(next).trim() === '') return -1; if (cx.slice(pos, pos + 1).charCodeAt(0) !== 35 || String.fromCharCode(next).trim() === '') return -1;
const end = cx.slice(pos, cx.end).search(/\s/); const end = cx.slice(pos, cx.end).search(/\s/);
return cx.addElement(cx.elt('Tag', pos, end === -1 ? cx.end : end, [ cx.elt('TagMeta', pos, pos + 1) ])); return cx.addElement(cx.elt('Tag', pos, end === -1 ? cx.end : pos + end, [ cx.elt('TagMeta', pos, pos + 1) ]));
}, },
}], }],
props: [ props: [