Skip to content

Commit

Permalink
fix: avoid escape "
Browse files Browse the repository at this point in the history
close #2091
  • Loading branch information
johnsoncodehk committed Nov 29, 2022
1 parent d83c9f9 commit 6d22b7f
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -1197,12 +1197,17 @@ export function generate(
codeGen.push('"');
let start = attrNode.loc.start.offset;
let end = attrNode.loc.end.offset;
if (end - start > attrNode.content.length) {
let content = attrNode.loc.source;
if (
(content.startsWith('"') && content.endsWith('"'))
|| (content.startsWith("'") && content.endsWith("'"))
) {
start++;
end--;
content = content.slice(1, -1);
}
codeGen.push([
toUnicodeIfNeed(attrNode.content),
toUnicodeIfNeed(content),
'template',
[start, end],
getCaps(capabilitiesSet.all),
Expand Down

0 comments on commit 6d22b7f

Please sign in to comment.