move attribute whitespace handling to JSXAttribute enter - fixes #872
This commit is contained in:
parent
f2eb1643c0
commit
1a899f5e77
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user