Skip to content

Commit 2d9041f

Browse files
committed
escape @ sigils in block comments (#3173)
1 parent 943c048 commit 2d9041f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compiler/compile/render_dom/Block.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import CodeBuilder from '../utils/CodeBuilder';
22
import deindent from '../utils/deindent';
33
import Renderer from './Renderer';
44
import Wrapper from './wrappers/shared/Wrapper';
5+
import { escape } from '../utils/stringify';
56

67
export interface BlockOptions {
78
parent?: Block;
@@ -408,7 +409,7 @@ export default class Block {
408409
const local_key = this.key && this.get_unique_name('key');
409410

410411
return deindent`
411-
${this.comment && `// ${this.comment}`}
412+
${this.comment && `// ${escape(this.comment, { only_escape_at_symbol: true })}`}
412413
function ${this.name}(${this.key ? `${local_key}, ` : ''}ctx) {
413414
${this.get_contents(local_key)}
414415
}

0 commit comments

Comments
 (0)