Skip to content

Commit

Permalink
fix(ssr): fix double escaping of ssrNode attribute values (vuejs#7224)
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 authored and hefeng committed Jan 25, 2019
1 parent 7c0e3b4 commit 643cb52
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 643cb52

Please sign in to comment.