Pārlūkot izejas kodu

fix(ssr): fix double escaping of ssrNode attribute values (#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 #7223
Felix Bünemann 8 gadi atpakaļ
vecāks
revīzija
73a89bf9e5
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      src/server/optimizing-compiler/modules.js

+ 1 - 1
src/server/optimizing-compiler/modules.js

@@ -77,7 +77,7 @@ function genAttrSegment (name: string, value: string): StringSegment {
         ? ` ${name}="${name}"`
         : value === '""'
           ? ` ${name}`
-          : ` ${name}=${value}`
+          : ` ${name}="${JSON.parse(value)}"`
     }
   } else {
     return {