MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / hasMarkdownSyntax

Function hasMarkdownSyntax

source code/components/Markdown.tsx:34–38  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

32// One pass instead of 10× includes scans.
33const MD_SYNTAX_RE = /[#*`|[>\-_~]|\n\n|^\d+\. |\n\d+\. /;
34function hasMarkdownSyntax(s: string): boolean {
35 // Sample first 500 chars — if markdown exists it's usually early (headers,
36 // code fence, list). Long tool outputs are mostly plain text tails.
37 return MD_SYNTAX_RE.test(s.length > 500 ? s.slice(0, 500) : s);
38}
39function cachedLexer(content: string): Token[] {
40 // Fast path: plain text with no markdown syntax → single paragraph token.
41 // Skips marked.lexer's full GFM parse (~3ms on long content). Not cached —

Callers 1

cachedLexerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected