MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / getFenceLanguage

Function getFenceLanguage

src/cm/lsp/tooltipExtensions.ts:206–214  ·  view source on GitHub ↗
(info: string)

Source from the content-addressed store, hash-verified

204}
205
206function getFenceLanguage(info: string): string {
207 const trimmed = info.trim();
208 if (!trimmed) return "";
209
210 if (trimmed.startsWith("{")) {
211 return trimmed.match(/\.([\w+#.-]+)/)?.[1] || "";
212 }
213 return trimmed.split(/\s+/, 1)[0] || "";
214}
215
216function collectMarkdownLanguages(markdown: string, result: Set<string>): void {
217 const fencePattern = /^ {0,3}(?:`{3,}|~{3,})[ \t]*([^\n]*)$/gm;

Callers 1

collectMarkdownLanguagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected