mirror of https://github.com/vuejs/core.git
chore: document rationale for ignoring some parsing errors
This commit is contained in:
parent
e702b278d4
commit
6022ac05c4
|
|
@ -2037,6 +2037,10 @@ describe('compiler: parse', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('Errors', () => {
|
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: {
|
const patterns: {
|
||||||
[key: string]: Array<{
|
[key: string]: Array<{
|
||||||
code: string
|
code: string
|
||||||
|
|
|
||||||
|
|
@ -291,7 +291,6 @@ const tokenizer = new Tokenizer(stack, {
|
||||||
if (currentElement && currentProp) {
|
if (currentElement && currentProp) {
|
||||||
if (quote !== QuoteType.NoValue) {
|
if (quote !== QuoteType.NoValue) {
|
||||||
if (__BROWSER__ && currentAttrValue.includes('&')) {
|
if (__BROWSER__ && currentAttrValue.includes('&')) {
|
||||||
// TODO should not do this in <script> or <style>
|
|
||||||
currentAttrValue = currentOptions.decodeEntities!(
|
currentAttrValue = currentOptions.decodeEntities!(
|
||||||
currentAttrValue,
|
currentAttrValue,
|
||||||
true
|
true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue