From: Evan You Date: Wed, 22 Nov 2023 06:04:31 +0000 (+0800) Subject: chore: document rationale for ignoring some parsing errors X-Git-Tag: v3.4.0-alpha.2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6022ac05c4e193544503b1cab90f6bfe21bd8d25;p=thirdparty%2Fvuejs%2Fcore.git chore: document rationale for ignoring some parsing errors --- diff --git a/packages/compiler-core/__tests__/parse.spec.ts b/packages/compiler-core/__tests__/parse.spec.ts index 0be1df9652..3bf0992c7a 100644 --- a/packages/compiler-core/__tests__/parse.spec.ts +++ b/packages/compiler-core/__tests__/parse.spec.ts @@ -2037,6 +2037,10 @@ describe('compiler: parse', () => { }) describe('Errors', () => { + // HTML parsing errors as specified at + // https://html.spec.whatwg.org/multipage/parsing.html#parse-errors + // We ignore some errors that do NOT affect parse result in meaningful ways + // but have non-trivial implementation cost. const patterns: { [key: string]: Array<{ code: string diff --git a/packages/compiler-core/src/parser/index.ts b/packages/compiler-core/src/parser/index.ts index e4afe395d0..1aec4c04bd 100644 --- a/packages/compiler-core/src/parser/index.ts +++ b/packages/compiler-core/src/parser/index.ts @@ -291,7 +291,6 @@ const tokenizer = new Tokenizer(stack, { if (currentElement && currentProp) { if (quote !== QuoteType.NoValue) { if (__BROWSER__ && currentAttrValue.includes('&')) { - // TODO should not do this in