Skip to content

Commit 00e3935

Browse files
felixbuenemannlovelope
authored andcommitted
fix(ssr): fix double escaping of ssrNode attribute values (vuejs#7224)
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
1 parent 75d47f4 commit 00e3935

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/server/optimizing-compiler/modules.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function genAttrSegment (name: string, value: string): StringSegment {
7777
? ` ${name}="${name}"`
7878
: value === '""'
7979
? ` ${name}`
80-
: ` ${name}=${value}`
80+
: ` ${name}="${JSON.parse(value)}"`
8181
}
8282
} else {
8383
return {

0 commit comments

Comments
 (0)