Use raw value of JSXText and JSXAttribute (#5256)
This commit is contained in:
committed by
Daniel Tschinder
parent
878a7c5fdb
commit
348cc5eeff
@@ -65,6 +65,11 @@ export default function (opts) {
|
||||
|
||||
if (t.isStringLiteral(value) && !t.isJSXExpressionContainer(node.value)) {
|
||||
value.value = value.value.replace(/\n\s+/g, " ");
|
||||
|
||||
// "raw" JSXText should not be used from a StringLiteral because it needs to be escaped.
|
||||
if (value.extra && value.extra.raw) {
|
||||
delete value.extra.raw;
|
||||
}
|
||||
}
|
||||
|
||||
if (t.isValidIdentifier(node.name.name)) {
|
||||
|
||||
Reference in New Issue
Block a user