mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-15 10:07:33 +02:00
feat(theme-classic): code block showLineNumbers (#7007)
This commit is contained in:
parent
4d9a0edf21
commit
ee4c984bc7
7 changed files with 168 additions and 11 deletions
|
@ -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"`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue