Skip to content

Commit

Permalink
escape @ sigils in debug comments (#3173)
Browse files Browse the repository at this point in the history
  • Loading branch information
Conduitry committed Jul 5, 2019
1 parent 943c048 commit 398c3ef
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Component from '../../../Component';
import { INode } from '../../../nodes/interfaces';
import { escape } from '../../../utils/stringify';

export default function create_debugging_comment(
node: INode,
Expand Down Expand Up @@ -28,5 +29,5 @@ export default function create_debugging_comment(
const start = locate(c);
const loc = `(${start.line + 1}:${start.column})`;

return `${loc} ${source.slice(c, d)}`.replace(/\s/g, ' ');
return escape(`${loc} ${source.slice(c, d)}`.replace(/\s/g, ' '), { only_escape_at_symbol: true });
}

0 comments on commit 398c3ef

Please sign in to comment.