feat(theme-classic): code block showLineNumbers (#7007)

This commit is contained in:
Alexey Pyltsyn 2022-04-13 15:42:35 +03:00 committed by GitHub
parent 4d9a0edf21
commit ee4c984bc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 168 additions and 11 deletions

View file

@ -77,6 +77,10 @@ export function parseCodeBlockTitle(metastring?: string): string {
return metastring?.match(codeBlockTitleRegex)?.groups!.title ?? '';
}
export function containsLineNumbers(metastring?: string): boolean {
return metastring?.includes('showLineNumbers') || false;
}
/**
* Gets the language name from the class name (set by MDX).
* e.g. `"language-javascript"` => `"javascript"`.