Skip to content

Commit

Permalink
Replace spaces, tabs and newline characters in Text nodes with a sing…
Browse files Browse the repository at this point in the history
…le space (fixes #164)
  • Loading branch information
RohanTalip committed Aug 21, 2019
1 parent 105ed56 commit 737897c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/vue-native-template-compiler/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3272,7 +3272,7 @@ var RenderGenerator = /*@__PURE__*/(function (BaseGenerator) {
* @param {Object} ast
*/
RenderGenerator.prototype.genText = function genText (ast) {
var text = transformSpecialNewlines(ast.text);
var text = transformSpecialNewlines(ast.text).replace(/[ \t\n]+/g, " ");
return JSON.stringify(text);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class RenderGenerator extends BaseGenerator {
* @param {Object} ast
*/
genText(ast) {
const text = transformSpecialNewlines(ast.text);
const text = transformSpecialNewlines(ast.text).replace(/[ \t\n]+/g, " ");
return JSON.stringify(text);
}

Expand Down

0 comments on commit 737897c

Please sign in to comment.