Skip to content

Commit 737897c

Browse files
committed
Replace spaces, tabs and newline characters in Text nodes with a single space (fixes #164)
1 parent 105ed56 commit 737897c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/vue-native-template-compiler/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3272,7 +3272,7 @@ var RenderGenerator = /*@__PURE__*/(function (BaseGenerator) {
32723272
* @param {Object} ast
32733273
*/
32743274
RenderGenerator.prototype.genText = function genText (ast) {
3275-
var text = transformSpecialNewlines(ast.text);
3275+
var text = transformSpecialNewlines(ast.text).replace(/[ \t\n]+/g, " ");
32763276
return JSON.stringify(text);
32773277
};
32783278

src/platforms/vue-native/compiler/codegen/RenderGenerator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class RenderGenerator extends BaseGenerator {
145145
* @param {Object} ast
146146
*/
147147
genText(ast) {
148-
const text = transformSpecialNewlines(ast.text);
148+
const text = transformSpecialNewlines(ast.text).replace(/[ \t\n]+/g, " ");
149149
return JSON.stringify(text);
150150
}
151151

0 commit comments

Comments
 (0)