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

Function collectMarkdownLanguages

src/cm/lsp/tooltipExtensions.ts:216–226  ·  view source on GitHub ↗
(markdown: string, result: Set<string>)

Source from the content-addressed store, hash-verified

214}
215
216function collectMarkdownLanguages(markdown: string, result: Set<string>): void {
217 const fencePattern = /^ {0,3}(?:`{3,}|~{3,})[ \t]*([^\n]*)$/gm;
218 for (
219 let match = fencePattern.exec(markdown);
220 match;
221 match = fencePattern.exec(markdown)
222 ) {
223 const language = getFenceLanguage(match[1] || "");
224 if (language) result.add(language);
225 }
226}
227
228function collectHoverLanguages(
229 contents: Hover["contents"],

Callers 1

collectHoverLanguagesFunction · 0.85

Calls 3

getFenceLanguageFunction · 0.85
addMethod · 0.80
execMethod · 0.65

Tested by

no test coverage detected