From 1d38eac15030ccb948964c3f679207f6d3663def Mon Sep 17 00:00:00 2001 From: daiwei Date: Tue, 3 Sep 2024 10:07:39 +0800 Subject: [PATCH] fix(cssVars): correctly escape double quotes in SSR --- .../__tests__/__snapshots__/compileScript.spec.ts.snap | 4 +++- packages/compiler-sfc/__tests__/compileScript.spec.ts | 5 +++++ packages/shared/src/escapeHtml.ts | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap index e175cc0a874..e092d83e743 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap @@ -880,11 +880,13 @@ export default { const count = ref(0) const style = { color: 'red' } + const height = ref(0) return (_ctx, _push, _parent, _attrs) => { const _cssVars = { style: { "--xxxxxxxx-count": (count.value), - "--xxxxxxxx-style\\\\.color": (style.color) + "--xxxxxxxx-style\\\\.color": (style.color), + "--xxxxxxxx-height\\\\ \\\\+\\\\ \\\\\\"px\\\\\\"": (height.value + "px") }} _push(\`', () => { import { ref } from 'vue' const count = ref(0) const style = { color: 'red' } + const height = ref(0)