(content: string)
| 290 | * typo doesn't silently swallow the rest of the file. |
| 291 | */ |
| 292 | export function stripHtmlComments(content: string): { |
| 293 | content: string |
| 294 | stripped: boolean |
| 295 | } { |
| 296 | if (!content.includes('<!--')) { |
| 297 | return { content, stripped: false } |
| 298 | } |
| 299 | // gfm:false is fine here — html-block detection is a CommonMark rule. |
| 300 | return stripHtmlCommentsFromTokens(new Lexer({ gfm: false }).lex(content)) |
| 301 | } |
| 302 | |
| 303 | function stripHtmlCommentsFromTokens(tokens: ReturnType<Lexer['lex']>): { |
| 304 | content: string |
nothing calls this directly
no test coverage detected