mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-22 04:28:10 +02:00
fix(utils): allow partially backticked markdown h1 contentTitles (#8314)
This commit is contained in:
parent
53aa9a2416
commit
ac81765024
2 changed files with 16 additions and 5 deletions
|
@ -155,10 +155,7 @@ export function parseFrontMatter(markdownFileContent: string): {
|
|||
}
|
||||
|
||||
function toTextContentTitle(contentTitle: string): string {
|
||||
if (contentTitle.startsWith('`') && contentTitle.endsWith('`')) {
|
||||
return contentTitle.substring(1, contentTitle.length - 1);
|
||||
}
|
||||
return contentTitle;
|
||||
return contentTitle.replace(/`(?<text>[^`]*)`/g, '$<text>');
|
||||
}
|
||||
|
||||
type ParseMarkdownContentTitleOptions = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue