chore: document rationale for ignoring some parsing errors

This commit is contained in:
Evan You 2023-11-22 14:04:31 +08:00
parent e702b278d4
commit 6022ac05c4
2 changed files with 4 additions and 1 deletions

View 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

View 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