Open t2ym opened 5 years ago
[buildtime preprocess][rare use case] SyntaxError: Unexpected token "][" with quotation " in id
"
"
html`${bind(this)}<span id="id-with-"">hello</span>`
diff --git a/demo/gulpfile.js b/demo/gulpfile.js index 9ce403c..eb41561 100644 --- a/demo/gulpfile.js +++ b/demo/gulpfile.js @@ -350,7 +350,7 @@ function traverseAst(ast, templates) { valueExpression = 'effectiveLang'; } while (tmpPart = partPath.shift()) { - valueExpression += `["${tmpPart}"]`; + valueExpression += `["${tmpPart.replace(/"/g, '\\"')}"]`; } if (isJSON) { if (useI18nFormatDataProperty) {
id
[buildtime preprocess][rare use case] SyntaxError: Unexpected token "][" with quotation
"
in idRoot Cause
"
is not escaped properly in generating preprocessed codesReproducible Code
Fix
Workarounds
"
inid
attributes