Skip to content

Admonition inserts a codehilite div when there are more than 12 spaces after the title #550

@pavelanni

Description

@pavelanni

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

  1. In the .md file enter !!! tip "Tip title"
    Make sure there are more than 12 spaces after the title
  2. Run mkdocs serve
  3. Inspect element in the admonition: see the added <div class="codehilite">. On the screen it looks like a grey strip one-line high.
  4. 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

Project configuration

theme: 'material'
markdown_extensions:
  - admonition
  - codehilite
  - pymdownx.arithmatex
  - pymdownx.betterem(smart_enable=all)
  - pymdownx.caret
  - pymdownx.critic
  - pymdownx.inlinehilite
  - pymdownx.magiclink
  - pymdownx.mark
  - pymdownx.smartsymbols
  - pymdownx.superfences
  - pymdownx.tasklist(custom_checkbox=true)
  - pymdownx.tilde

System information

  • OS: [The operating system you're running]
    Fedora Linux 25
  • Browser: [The browser used, if relevant]
    Mozilla Firefox

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug report.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions