aboutsummaryrefslogtreecommitdiff
path: root/node_modules/pogen/pogen.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/pogen/pogen.js')
-rw-r--r--node_modules/pogen/pogen.js13
1 files changed, 3 insertions, 10 deletions
diff --git a/node_modules/pogen/pogen.js b/node_modules/pogen/pogen.js
index 1a0c49bf1..ed634ef0d 100644
--- a/node_modules/pogen/pogen.js
+++ b/node_modules/pogen/pogen.js
@@ -188,15 +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 + " ";
- }
- console.log("got", JSON.stringify(s));
+ var s = e.getFullText();
+ var t = s.split("\n").map(trim).join(" ");
fragments.push(t);
}
case ts.SyntaxKind.JsxOpeningElement:
@@ -219,7 +212,7 @@ function processFile(sourceFile) {
}
};
ts.forEachChild(node, process);
- return fragments.join("");
+ return fragments.join("").trim().replace(/ +/g, " ");
}
function getJsxSingular(node) {
var res;