aboutsummaryrefslogtreecommitdiff
path: root/tooling/pogen/pogen.js
diff options
context:
space:
mode:
Diffstat (limited to 'tooling/pogen/pogen.js')
-rw-r--r--tooling/pogen/pogen.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/tooling/pogen/pogen.js b/tooling/pogen/pogen.js
index 03cc0c34e..787a7ec7e 100644
--- a/tooling/pogen/pogen.js
+++ b/tooling/pogen/pogen.js
@@ -188,7 +188,14 @@ function processFile(sourceFile) {
case ts.SyntaxKind.JsxText:
{
var e = childNode;
- var t = e.getText().split("\n").map(trim).join("\n");
+ 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 + " ";
+ }
fragments.push(t);
}
case ts.SyntaxKind.JsxOpeningElement: