diff --git a/src/nodes/html.ts b/src/nodes/html.ts index f6f4ea7..e749ae4 100644 --- a/src/nodes/html.ts +++ b/src/nodes/html.ts @@ -1102,7 +1102,7 @@ export function base_parse(data: string, options = {} as Partial) { data = `<${frameflag}>${data}`; const { lowerCaseTagName, fixNestedATags } = options; - const dataEndPos = data.length - (frameflag.length + 2); + const dataEndPos = data.length - (frameflag.length + 3); const frameFlagOffset = frameflag.length + 2; markupPattern.lastIndex = 0; diff --git a/test/tests/incomplete-blocktext.js b/test/tests/incomplete-blocktext.js new file mode 100644 index 0000000..ca43f1a --- /dev/null +++ b/test/tests/incomplete-blocktext.js @@ -0,0 +1,16 @@ +const { parse } = require('@test/test-target'); + +describe('unterminated block-text elements', function () { + it('does not append a stray "<" to an unclosed '); + }); + it('does not append a stray "<" to an unclosed