]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: document rationale for ignoring some parsing errors
authorEvan You <yyx990803@gmail.com>
Wed, 22 Nov 2023 06:04:31 +0000 (14:04 +0800)
committerEvan You <yyx990803@gmail.com>
Sat, 25 Nov 2023 08:18:29 +0000 (16:18 +0800)
packages/compiler-core/__tests__/parse.spec.ts
packages/compiler-core/src/parser/index.ts

index 0be1df96524495546b3e61cb8a02a8dc34f9895d..3bf0992c7ab03fa8552030adee4d356d249c78eb 100644 (file)
@@ -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
index e4afe395d0e730c2c8c20678f029e06d9d0d6ecf..1aec4c04bdcc6a9e5a647223d765e6ea776fa5ff 100644 (file)
@@ -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 <script> or <style>
           currentAttrValue = currentOptions.decodeEntities!(
             currentAttrValue,
             true