Skip to content

Commit

Permalink
Merge pull request #3186 from Conduitry/gh-3173
Browse files Browse the repository at this point in the history
escape `@` sigils in block comments
  • Loading branch information
Rich-Harris authored Jul 6, 2019
2 parents 943c048 + 2d9041f commit 6adf7b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/compiler/compile/render_dom/Block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import CodeBuilder from '../utils/CodeBuilder';
import deindent from '../utils/deindent';
import Renderer from './Renderer';
import Wrapper from './wrappers/shared/Wrapper';
import { escape } from '../utils/stringify';

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

return deindent`
${this.comment && `// ${this.comment}`}
${this.comment && `// ${escape(this.comment, { only_escape_at_symbol: true })}`}
function ${this.name}(${this.key ? `${local_key}, ` : ''}ctx) {
${this.get_contents(local_key)}
}
Expand Down

0 comments on commit 6adf7b3

Please sign in to comment.