MCPcopy Create free account
hub / github.com/cweijan/vscode-office / getLanguageName

Function getLanguageName

vditor/src/ts/codeBlock/codeMirrorPreviewRender.ts:30–33  ·  view source on GitHub ↗
(code: HTMLElement)

Source from the content-addressed store, hash-verified

28};
29
30const getLanguageName = (code: HTMLElement) => {
31 const match = code.className.match(/language-([^\s]+)/);
32 return match ? match[1] : "";
33};
34
35const loadLanguage = (languageName: string): Promise<LanguageSupport | undefined> => {
36 return loadCodeMirrorHighlightLanguage(languageName);

Callers 2

mountPreviewCodeMirrorFunction · 0.85
mountCodeMirrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected