Skip to content

Commit f98f42d

Browse files
fix(compiler): fix double escaping of ssrNode attribute values
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 bd4819e commit f98f42d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/server/optimizing-compiler/modules.js

Lines changed: 1 addition & 1 deletion
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)