From 2099a9a1000a3c07e9ad893743ccbcd86002fb04 Mon Sep 17 00:00:00 2001 From: andrmaz <60042277+andrmaz@users.noreply.github.com> Date: Fri, 26 Apr 2024 23:21:30 +0200 Subject: [PATCH 1/2] feat: display admonition without heading --- .../src/theme/Admonition/Layout/index.tsx | 2 +- website/_dogfooding/_pages tests/markdown-tests-mdx.mdx | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-theme-classic/src/theme/Admonition/Layout/index.tsx b/packages/docusaurus-theme-classic/src/theme/Admonition/Layout/index.tsx index 7bdda31bc386..eafe0400c626 100644 --- a/packages/docusaurus-theme-classic/src/theme/Admonition/Layout/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/Admonition/Layout/index.tsx @@ -50,7 +50,7 @@ export default function AdmonitionLayout(props: Props): JSX.Element { const {type, icon, title, children, className} = props; return ( - + {title || icon ? : null} {children} ); diff --git a/website/_dogfooding/_pages tests/markdown-tests-mdx.mdx b/website/_dogfooding/_pages tests/markdown-tests-mdx.mdx index feaf146f059d..c14f1aa99a77 100644 --- a/website/_dogfooding/_pages tests/markdown-tests-mdx.mdx +++ b/website/_dogfooding/_pages tests/markdown-tests-mdx.mdx @@ -333,6 +333,12 @@ test :::: +::: + +Admonition content without heading + +::: + ## Linking This is a test page to see if Docusaurus Markdown features are working properly From 18ad4884ae44ccf397c474b257b82b2d3d67ec36 Mon Sep 17 00:00:00 2001 From: andrmaz <60042277+andrmaz@users.noreply.github.com> Date: Sat, 27 Apr 2024 14:50:51 +0200 Subject: [PATCH 2/2] feat: add admonition dogfooding test --- .../_pages tests/markdown-tests-mdx.mdx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/website/_dogfooding/_pages tests/markdown-tests-mdx.mdx b/website/_dogfooding/_pages tests/markdown-tests-mdx.mdx index c14f1aa99a77..b54eef02ac59 100644 --- a/website/_dogfooding/_pages tests/markdown-tests-mdx.mdx +++ b/website/_dogfooding/_pages tests/markdown-tests-mdx.mdx @@ -333,11 +333,19 @@ test :::: -::: +```mdx-code-block +import Admonition from '@theme/Admonition'; -Admonition content without heading +export function AdmonitionWithoutHeading(props) { + return ( + + Admonition content without heading + + ); +} +``` -::: + ## Linking