mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-02 00:09:48 +02:00
fix(theme): restore former code block theme-common internal APIs (#11153)
Co-authored-by: slorber <749374+slorber@users.noreply.github.com>
This commit is contained in:
parent
91d95a9ac1
commit
59e9eb20fa
2 changed files with 14 additions and 0 deletions
|
@ -39,6 +39,14 @@ export {
|
|||
getPrismCssVariables,
|
||||
CodeBlockContextProvider,
|
||||
useCodeBlockContext,
|
||||
|
||||
// TODO Docusaurus v4: remove, only kept for internal retro-compatibility
|
||||
// See https://github.com/facebook/docusaurus/pull/11153
|
||||
parseCodeBlockTitle,
|
||||
parseClassNameLanguage as parseLanguage,
|
||||
parseLines,
|
||||
getLineNumbersStart,
|
||||
containsLineNumbers,
|
||||
} from './utils/codeBlockUtils';
|
||||
|
||||
export {DEFAULT_SEARCH_TAG} from './utils/searchUtils';
|
||||
|
|
|
@ -188,6 +188,12 @@ export function getLineNumbersStart({
|
|||
return getMetaLineNumbersStart(metastring);
|
||||
}
|
||||
|
||||
// TODO Docusaurus v4: remove, only kept for internal retro-compatibility
|
||||
// See https://github.com/facebook/docusaurus/pull/11153
|
||||
export function containsLineNumbers(metastring?: string): boolean {
|
||||
return Boolean(metastring?.includes('showLineNumbers'));
|
||||
}
|
||||
|
||||
type ParseCodeLinesParam = {
|
||||
/**
|
||||
* The full metastring, as received from MDX. Line ranges declared here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue