From d088df236a2f022ff2f4c9a1a59157678f92a3a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20B=C3=BCnemann?= Date: Tue, 12 Dec 2017 23:06:11 +0100 Subject: [PATCH] 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 --- src/server/optimizing-compiler/modules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/optimizing-compiler/modules.js b/src/server/optimizing-compiler/modules.js index 41b1af1d9d2..69a7be87390 100644 --- a/src/server/optimizing-compiler/modules.js +++ b/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 {