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