Fix incorrect tag end position
This commit is contained in:
parent
e9ffdd58a5
commit
32b6cf4af7
|
|
@ -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: [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue