Skip to content

Commit

Permalink
fix(compiler): fix double escaping of ssrNode attribute values
Browse files Browse the repository at this point in the history
This fixes a double escaping of attribute values in the SSR optimizing
compiler by unescaping the value in `genAttrSegment` because literal
attribute values get escaped early during `processAttrs` before it is
known, if this attribute will be optimized to an _ssrNode string template,
which is escaped as well, causing the double escape.

fix vuejs#7223
  • Loading branch information
felixbuenemann committed Dec 12, 2017
1 parent bd4819e commit f98f42d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/optimizing-compiler/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function genAttrSegment (name: string, value: string): StringSegment {
? ` ${name}="${name}"`
: value === '""'
? ` ${name}`
: ` ${name}=${value}`
: ` ${name}="${JSON.parse(value)}"`
}
} else {
return {
Expand Down

0 comments on commit f98f42d

Please sign in to comment.