You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using MkDocs with Python Markdown. I noticed this strange bug:
Expected behavior
When I insert !!! tip "Tip title" or !!! note "Note title" I expect it to create <div class="admonition tip"> then <div class="admonition-title"> and then a normal paragraph.
Actual behavior
When in my .md file the string !!! tip "Tip title" has more than 12 spaces after the title (till the end of the line) it creates an additional div after the title and before the paragraph: <div class="codehilite">. On the screen it looks like a grey strip one-line high.
It's not a big deal, especially after I figured it out and especially if you make white spaces visible in the editor. But it might surprise somebody.
Steps to reproduce the bug
In the .md file enter !!! tip "Tip title"
Make sure there are more than 12 spaces after the title
Run mkdocs serve
Inspect element in the admonition: see the added <div class="codehilite">. On the screen it looks like a grey strip one-line high.
Remove spaces to make their number 12 or less, check that it disappears.
Package versions
Python: python --version
Python 3.5.2
MkDocs: mkdocs --version
mkdocs, version 0.16.1
Material: pip show mkdocs-material | grep -E ^Version
Version: 1.2.0
Most likey the trailing whitespace is being treated as a sperate line. It may be best to just include the trailing whitespace in the admonition header regex, and then just throw it away.
@facelessuser you are absolutely right. Not sure why whitespace was so strict in that regex. I even had to account for the newline later. Anyway, its fixed now.
I'm using MkDocs with Python Markdown. I noticed this strange bug:
Expected behavior
When I insert
!!! tip "Tip title"
or!!! note "Note title"
I expect it to create<div class="admonition tip">
then<div class="admonition-title">
and then a normal paragraph.Actual behavior
When in my .md file the string
!!! tip "Tip title"
has more than 12 spaces after the title (till the end of the line) it creates an additional div after the title and before the paragraph:<div class="codehilite">
. On the screen it looks like a grey strip one-line high.It's not a big deal, especially after I figured it out and especially if you make white spaces visible in the editor. But it might surprise somebody.
Steps to reproduce the bug
!!! tip "Tip title"
Make sure there are more than 12 spaces after the title
<div class="codehilite">
. On the screen it looks like a grey strip one-line high.Package versions
python --version
Python 3.5.2
mkdocs --version
mkdocs, version 0.16.1
pip show mkdocs-material | grep -E ^Version
Version: 1.2.0
Project configuration
System information
Fedora Linux 25
Mozilla Firefox
The text was updated successfully, but these errors were encountered: