]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(compiler-core): should not condense whitespace in RAWTEXT mode
authorEvan You <yyx990803@gmail.com>
Thu, 7 Nov 2019 01:52:19 +0000 (20:52 -0500)
committerEvan You <yyx990803@gmail.com>
Thu, 7 Nov 2019 01:52:19 +0000 (20:52 -0500)
packages/compiler-core/src/parse.ts

index 57f21680f324c188380c52cfe5a56f8ddbd06b48..3dcef5106acfec45c38b7f6f8aa8373716906a87 100644 (file)
@@ -215,7 +215,10 @@ function parseChildren(
   // Whitespace management for more efficient output
   // (same as v2 whitespance: 'condense')
   let removedWhitespace = false
-  if (!parent || !context.options.isPreTag(parent.tag)) {
+  if (
+    mode !== TextModes.RAWTEXT &&
+    (!parent || !context.options.isPreTag(parent.tag))
+  ) {
     for (let i = 0; i < nodes.length; i++) {
       const node = nodes[i]
       if (node.type === NodeTypes.TEXT) {