compiler: fix jsx text attributes with double quotes (#29079)

Fixes #29069 by detecting the presence of double-quotes in JSX attribute
strings and falling back to using an expression container.
This commit is contained in:
Joseph Savona
2024-05-15 14:40:33 -07:00
committed by GitHub
parent 5e11e7fc20
commit 3adca7a477
8 changed files with 192 additions and 0 deletions
@@ -2040,6 +2040,9 @@ function codegenJsxAttribute(
switch (innerValue.type) {
case "StringLiteral": {
value = innerValue;
if (value.value.indexOf('"') !== -1) {
value = createJsxExpressionContainer(value.loc, value);
}
break;
}
default: {