Skip to content

Commit

Permalink
fix(theme): <Admonition> should render properly without heading/icon (
Browse files Browse the repository at this point in the history
  • Loading branch information
andrmaz authored Apr 30, 2024
1 parent 3ee7760 commit c967ea5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function AdmonitionLayout(props: Props): JSX.Element {
const {type, icon, title, children, className} = props;
return (
<AdmonitionContainer type={type} className={className}>
<AdmonitionHeading title={title} icon={icon} />
{title || icon ? <AdmonitionHeading title={title} icon={icon} /> : null}
<AdmonitionContent>{children}</AdmonitionContent>
</AdmonitionContainer>
);
Expand Down
14 changes: 14 additions & 0 deletions website/_dogfooding/_pages tests/markdown-tests-mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,20 @@ test

::::

```mdx-code-block
import Admonition from '@theme/Admonition';
export function AdmonitionWithoutHeading(props) {
return (
<Admonition {...props} type="info" icon={null} title={null}>
Admonition content without heading
</Admonition>
);
}
```

<AdmonitionWithoutHeading />

## Linking

This is a test page to see if Docusaurus Markdown features are working properly
Expand Down

0 comments on commit c967ea5

Please sign in to comment.