We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 66768ec + 4b621c1 commit 896f278Copy full SHA for 896f278
src/htmltojsx.js
@@ -434,7 +434,7 @@ HTMLtoJSX.prototype = {
434
return;
435
}
436
437
- var text = escapeSpecialChars(node.textContent)
+ var text = escapeSpecialChars(node.textContent);
438
439
if (this._inPreTag) {
440
// If this text is contained within a <pre>, we need to ensure the JSX
@@ -446,6 +446,11 @@ HTMLtoJSX.prototype = {
446
return '{' + JSON.stringify(whitespace) + '}';
447
});
448
} else {
449
+ // Handle any curly braces.
450
+ text = text
451
+ .replace(/(\{|\})/g, function(brace) {
452
+ return '{\'' + brace + '\'}';
453
+ });
454
// If there's a newline in the text, adjust the indent level
455
if (text.indexOf('\n') > -1) {
456
text = text.replace(/\n\s*/g, this._getIndentedNewline());
0 commit comments