squidfunk / mkdocs-material

Documentation that simply works

Home Page:https://squidfunk.github.io/mkdocs-material/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Admonitions inside content tabs

kulttuuri opened this issue · comments

Contribution guidelines

I've found a bug and checked that ...

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

Hi!

I'm trying to add admonition inside a content tab, but that doesn't seem to work that way around. I have tried with collapsible and non-collapsible admonitions. I've tried for example this:

=== "View All Elements"
      ```py
      print("Hello World")
      ```
      
      ???+ example "Example Output"
          > Hello World

Expected behaviour

The expected behavior is for the admonition to render correctly.

Actual behaviour

This is what renders in the browser:
image

Steps to reproduce

  1. Create the block with this code:
=== "View All Elements"
      ```py
      print("Hello World")
      ```
      
      ???+ example "Example Output"
          > Hello World
  1. Does not render correctly.

Package versions

  • Python: 3.9.10
  • MkDocs: 1.3.0
  • Material: 8.3.5+insiders.4.18.1

Configuration

site_name: Test Site
markdown_extensions:
  - pymdownx.superfences
  - pymdownx.tabbed:
      alternate_style: true
  - admonition
  - pymdownx.details

System information

  • Operating system: MacOS
  • Browser: Chrome

Thanks for reporting. This is definitely a formatting issue. Please make sure that when using content tabs, nested content is always indented by four spaces. You're using 6, which is inconsistent with what SuperFences expects. This works:

=== "View All Elements"
    ```py
    print("Hello World")
    ```

    ???+ example "Example Output"
        > Hello World

Bildschirmfoto 2022-06-15 um 18 06 32

That was it, thank you! 👍