diff --git a/src/compiler/parse/utils/html.ts b/src/compiler/parse/utils/html.ts index b49989eacd36..13ff553a3f20 100644 --- a/src/compiler/parse/utils/html.ts +++ b/src/compiler/parse/utils/html.ts @@ -36,7 +36,7 @@ const windows_1252 = [ ]; const entity_pattern = new RegExp( - `&(#?(?:x[\\w\\d]+|\\d+|${Object.keys(entities).join('|')}));?`, + `&(#?(?:x[\\w\\d]+|\\d+|${Object.keys(entities).join('|')}))(?:;|\\b)`, 'g' ); diff --git a/test/parser/samples/attribute-escaped/input.svelte b/test/parser/samples/attribute-escaped/input.svelte index 82186dcee47b..4c9cd5ff6885 100644 --- a/test/parser/samples/attribute-escaped/input.svelte +++ b/test/parser/samples/attribute-escaped/input.svelte @@ -1 +1 @@ -
+
diff --git a/test/parser/samples/attribute-escaped/output.json b/test/parser/samples/attribute-escaped/output.json index e60a8c253189..a8498bd574cc 100644 --- a/test/parser/samples/attribute-escaped/output.json +++ b/test/parser/samples/attribute-escaped/output.json @@ -1,27 +1,27 @@ { "html": { "start": 0, - "end": 41, + "end": 83, "type": "Fragment", "children": [ { "start": 0, - "end": 41, + "end": 83, "type": "Element", "name": "div", "attributes": [ { "start": 5, - "end": 34, + "end": 76, "type": "Attribute", "name": "data-foo", "value": [ { "start": 15, - "end": 33, + "end": 75, "type": "Text", - "raw": ""quoted"", - "data": "\"quoted\"" + "raw": "semi:"space:" letter:"e number:"1 end:"", + "data": "semi:\"space:\" letter:"e number:"1 end:\"" } ] } diff --git a/test/runtime/samples/html-entities/_config.js b/test/runtime/samples/html-entities/_config.js index 1591f31a5362..c8c2de84036c 100644 --- a/test/runtime/samples/html-entities/_config.js +++ b/test/runtime/samples/html-entities/_config.js @@ -9,6 +9,6 @@ export default { A - ¬anentity; + &notanentity; ` }; \ No newline at end of file