Skip to content

Commit

Permalink
Opportunistically preserve original quote stye
Browse files Browse the repository at this point in the history
  • Loading branch information
ef4 committed Feb 25, 2025
1 parent bc7a615 commit 1c34f75
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/@glimmer/syntax/lib/generation/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,14 @@ export default class Printer {

AttrNodeValue(value: ASTv1.AttrNode['value']): void {
if (value.type === 'TextNode') {
this.buffer += '"';
let quote = '"';
let originalChar = value.loc.asString()[0];
if (originalChar === "'") {
quote = "'";
}
this.buffer += quote;
this.TextNode(value, true);
this.buffer += '"';
this.buffer += quote;
} else {
this.Node(value);
}
Expand Down

0 comments on commit 1c34f75

Please sign in to comment.