Expected behaviour when indenting twice (two tabs) in admonitions? #6168
-
A visual bug recently appeared: admonition content being displayed as code (example: https://docs.n8n.io/user-management/ldap/). I can't pinpoint exactly when it started, but only the last few days. However, I am not sure if this is a bug with the theme, or intended behaviour, so before I file a bug report: is it intended that when you put two tabs in an admonition it renders as code? For example, this inserts code formatting: !!! note "an example note" While this does not: !!! note "an example note" I would have expected the tabs to be replaced with spaces (we actually had to do a workaround to prevent this in our code blocks), so am a bit surprised they're affecting it at all. The equivalent spaces (4) don't result in code formatting. I have done a minimal reproduction, and it isn't our workaround causing this - it occurs without it in place. @squidfunk this is an n8n problem, not a personal site problem, in case that affects response time :-) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 25 replies
-
Ok the more I look at this the more I think not-bug. Python Markdown will be replacing two tabs with eight spaces? |
Beta Was this translation helpful? Give feedback.
-
Hmm, I'm pretty sure this has nothing to do with Material for MkDocs, but with Python Markdown extensions in general. Could you please try the |
Beta Was this translation helpful? Give feedback.
-
So, I will give some insight into the recent surfacing of this and state it is not a bug. Admonitions, in this format, have always required that the content be indented. Additionally, indented blocks are generally treated as code blocks in Markdown. So to have indented code blocks under an admonition you would have to indent twice. Now, there was a bug that I recently fixed in admonitions. Indented code blocks were not treated properly. Python-Markdown/markdown#1329 Now that this has been fixed, indented code blocks now work properly when they are the first block under admonitions, which is likely what you are seeing. With all of that said, I've never been a fan of having to indent the all content under Admonitions, Details, Definitions, Tabs, etc. Pymdown Extensions implemented plugins for details and tabs using this Admonition style approach because it was a bit complicated to create such blocks with complex levels of blocks under them under Python Markdown. Recently though, I have created a way to do so without requiring all of this indentation. If you do not like these "indentation" style containers, you can use Pymdownx block plugins for Admonition, Details, Tabs, etc. https://facelessuser.github.io/pymdown-extensions/extensions/blocks/plugins/admonition/. |
Beta Was this translation helpful? Give feedback.
-
@alexvoss did the PR to support the new admonition syntax go live yet? Had a quick scan through recent release notes and can't spot what version it's in. I'd love to get us upgraded to this as we keep hitting blips in our admonition formatting. |
Beta Was this translation helpful? Give feedback.
So, I will give some insight into the recent surfacing of this and state it is not a bug. Admonitions, in this format, have always required that the content be indented. Additionally, indented blocks are generally treated as code blocks in Markdown. So to have indented code blocks under an admonition you would have to indent twice.
Now, there was a bug that I recently fixed in admonitions. Indented code blocks were not treated properly. Python-Markdown/markdown#1329
Now that this has been fixed, indented code blocks now work properly when they are the first block under admonitions, which is likely what you are seeing.
With all of that said, I've never been a fan of having to indent the all …