Skip to content

Commit b6252dc

Browse files
bughitLostlover
authored andcommitted
fix: decode single quotes in html attributes (vuejs#9341)
1 parent 9881823 commit b6252dc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/compiler/parser/html-parser.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ const decodingMap = {
3636
'"': '"',
3737
'&': '&',
3838
'
': '\n',
39-
'	': '\t'
39+
'	': '\t',
40+
''': "'"
4041
}
41-
const encodedAttr = /&(?:lt|gt|quot|amp);/g
42-
const encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#10|#9);/g
42+
const encodedAttr = /&(?:lt|gt|quot|amp|#39);/g
43+
const encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g
4344

4445
// #5992
4546
const isIgnoreNewlineTag = makeMap('pre,textarea', true)

0 commit comments

Comments
 (0)