mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-06 21:03:47 +02:00
fix(theme-classic): polish admonition details, render title-only admonitions (#8150)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
32dc1eddba
commit
f3563ca23c
5 changed files with 71 additions and 4 deletions
|
@ -20,10 +20,10 @@ function extractMDXAdmonitionTitle(children: ReactNode): {
|
|||
(item.props as {mdxType: string} | null)?.mdxType ===
|
||||
'mdxAdmonitionTitle',
|
||||
) as JSX.Element | undefined;
|
||||
const rest = <>{items.filter((item) => item !== mdxAdmonitionTitle)}</>;
|
||||
const rest = items.filter((item) => item !== mdxAdmonitionTitle);
|
||||
return {
|
||||
mdxAdmonitionTitle: mdxAdmonitionTitle?.props.children,
|
||||
rest,
|
||||
rest: rest.length > 0 ? <>{rest}</> : null,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue