MCPcopy Index your code
hub / github.com/codeaashu/claude-code / stripHtmlComments

Function stripHtmlComments

src/utils/claudemd.ts:292–301  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

290 * typo doesn't silently swallow the rest of the file.
291 */
292export 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
303function stripHtmlCommentsFromTokens(tokens: ReturnType<Lexer['lex']>): {
304 content: string

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected