Skip to content

Commit 73f74ba

Browse files
committed
fix(compiler): support decode   in the value of prop and attribute
(fix vuejs#8895)
1 parent 38cfb2b commit 73f74ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/compiler/parser/html-parser.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const isPlainTextElement = makeMap('script,style,textarea', true)
3131
const reCache = {}
3232

3333
const decodingMap = {
34+
' ': ' ',
3435
'&lt;': '<',
3536
'&gt;': '>',
3637
'&quot;': '"',
@@ -39,8 +40,8 @@ const decodingMap = {
3940
'&#9;': '\t',
4041
'&#39;': "'"
4142
}
42-
const encodedAttr = /&(?:lt|gt|quot|amp|#39);/g
43-
const encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g
43+
const encodedAttr = /&(?:lt|gt|quot|amp|#39|nbsp);/g
44+
const encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|nbsp|#10|#9);/g
4445

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

0 commit comments

Comments
 (0)