diff --git a/lib/babel/transformation/helpers/build-react-transformer.js b/lib/babel/transformation/helpers/build-react-transformer.js index 7506a305a8..3e4c5a172a 100644 --- a/lib/babel/transformation/helpers/build-react-transformer.js +++ b/lib/babel/transformation/helpers/build-react-transformer.js @@ -44,13 +44,15 @@ module.exports = function (exports, opts) { }; exports.JSXAttribute = { - exit: function (node) { - var value = node.value || t.literal(true); - + enter: function (node) { + var value = node.value; if (t.isLiteral(value) && isString(value.value)) { value.value = value.value.replace(/\n\s+/g, " "); } + }, + exit: function (node) { + var value = node.value || t.literal(true); return t.inherits(t.property("init", node.name, value), node); } };