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

Function hasMarkdownSyntax

src/components/Markdown.tsx:67–71  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

65// One pass instead of 10× includes scans.
66const MD_SYNTAX_RE = /[#*`|[>\-_~]|\n\n|^\d+\. |\n\d+\. /;
67function hasMarkdownSyntax(s: string): boolean {
68 // Sample first 500 chars — if markdown exists it's usually early (headers,
69 // code fence, list). Long tool outputs are mostly plain text tails.
70 return MD_SYNTAX_RE.test(s.length > 500 ? s.slice(0, 500) : s);
71}
72function cachedLexer(content: string): {
73 tokens: Token[];
74 cacheKey?: string;

Callers 1

cachedLexerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected