jsx: replace all newlines and excess whitespace with spaces - fixes #142

This commit is contained in:
Sebastian McKenzie 2014-11-11 15:26:25 +11:00
parent 7d0dae129c
commit cfee68aa67

View File

@ -81,6 +81,11 @@ exports.XJSElement = {
var children = node.children;
_.each(children, function (child) {
if (t.isLiteral(child) && _.isString(child.value)) {
child.value = child.value.trim().replace(/\n(\s+)/g, " ");
if (!child.value) return;
}
callExpr.arguments.push(child);
});