diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-02-22 10:25:11 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-02-22 10:25:11 +0100 |
commit | 42eb17e7e021476227b846d45cc43409aa451b6e (patch) | |
tree | 2a962ee3100aae83c83d27b471d2199ac8954065 /tooling/pogen/pogen.js | |
parent | b15f40aea5adcfed4d7ed499ec01988955bdc929 (diff) |
i18n fixes
Diffstat (limited to 'tooling/pogen/pogen.js')
-rw-r--r-- | tooling/pogen/pogen.js | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/tooling/pogen/pogen.js b/tooling/pogen/pogen.js index 787a7ec7e..ed634ef0d 100644 --- a/tooling/pogen/pogen.js +++ b/tooling/pogen/pogen.js @@ -188,14 +188,8 @@ function processFile(sourceFile) { case ts.SyntaxKind.JsxText: { var e = childNode; - var s = e.getText(); - var t = s.split("\n").map(trim).join("\n"); - if (s.length >= 1 && (s[0] === "\n" || s[0] === " ")) { - t = " " + t; - } - if (s.length >= 1 && (s[s.length - 1] === "\n" || s[s.length - 1] === " ")) { - t = t + " "; - } + var s = e.getFullText(); + var t = s.split("\n").map(trim).join(" "); fragments.push(t); } case ts.SyntaxKind.JsxOpeningElement: @@ -218,7 +212,7 @@ function processFile(sourceFile) { } }; ts.forEachChild(node, process); - return fragments.join(""); + return fragments.join("").trim().replace(/ +/g, " "); } function getJsxSingular(node) { var res; |