MCPcopy Create free account
hub / github.com/Noumena-Network/code / stripHtmlComments

Function stripHtmlComments

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

Source from the content-addressed store, hash-verified

296 * typo doesn't silently swallow the rest of the file.
297 */
298export 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
309function stripHtmlCommentsFromTokens(tokens: ReturnType<Lexer['lex']>): {
310 content: string

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected