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 = {
|
exports.JSXAttribute = {
|
||||||
exit: function (node) {
|
enter: function (node) {
|
||||||
var value = node.value || t.literal(true);
|
var value = node.value;
|
||||||
|
|
||||||
if (t.isLiteral(value) && isString(value.value)) {
|
if (t.isLiteral(value) && isString(value.value)) {
|
||||||
value.value = value.value.replace(/\n\s+/g, " ");
|
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);
|
return t.inherits(t.property("init", node.name, value), node);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user