Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 5x 5x 71x 71x 71x 1294x 126x 1168x | import { CommentParser } from 'src/comment'; export class CommentProcessor { private readCommentRegex = /<!--.*-->/; private parser: CommentParser = new CommentParser(); process(markdown: string) { return markdown .split('\n') .map(line => { if (this.parser.lineHasComment(line)) { return line.replace(this.readCommentRegex, this.parser.commentToString(this.parser.parseLine(line))); } else { return line; } }) .join('\n'); } } |