Skip to content

Commit 31d3ec6

Browse files
mingmingwonyyx990803
authored andcommitted
refactor: simplify html parser attribute regex (#6414)
1 parent 38d5218 commit 31d3ec6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/compiler/parser/html-parser.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { isNonPhrasingTag } from 'web/compiler/util'
1414

1515
// Regular Expressions for parsing tags and attributes
1616
const singleAttrIdentifier = /([^\s"'<>/=]+)/
17-
const singleAttrAssign = /(?:=)/
17+
const singleAttrAssign = /(=)/
1818
const singleAttrValues = [
1919
// attr value double quotes
2020
/"([^"]*)"+/.source,
@@ -25,7 +25,7 @@ const singleAttrValues = [
2525
]
2626
const attribute = new RegExp(
2727
'^\\s*' + singleAttrIdentifier.source +
28-
'(?:\\s*(' + singleAttrAssign.source + ')' +
28+
'(?:\\s*' + singleAttrAssign.source +
2929
'\\s*(?:' + singleAttrValues.join('|') + '))?'
3030
)
3131

0 commit comments

Comments
 (0)