Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abbreviations plugin not working with Material for MkDocs #7839

Closed
4 tasks done
leviofanh opened this issue Dec 25, 2024 · 2 comments
Closed
4 tasks done

Abbreviations plugin not working with Material for MkDocs #7839

leviofanh opened this issue Dec 25, 2024 · 2 comments
Labels
resolved by config change Issue can be mitigated by the reporter

Comments

@leviofanh
Copy link

leviofanh commented Dec 25, 2024

Context

Environment

  • Material for MkDocs version: 9.5.49
  • Python version: 3.12
  • Operating System: Windows 10

Bug description

The Python Markdown abbreviations plugin (abbr) is not functioning correctly when used with Material for MkDocs.
Abbreviations are being rendered as plain text instead of creating the expected HTML abbreviation elements with tooltips.

изображение

Related links

Reporting a bug

The abbreviations extension is properly configured in mkdocs.yml and should work according to the:
Material for MkDocs documentation
and
Python Markdown documentation

Reproduction

9.5.49-abbreviations-plugin-not-working.zip

Steps to reproduce

  1. Create a new Markdown file (e.g., test.md)
  2. Add the following content to the file:
    [HTML]: HyperText Markup Language 
  3. Configure mkdocs.yml with the following settings:
    site_name: Test Documentation
    theme:
      name: material
      
    markdown_extensions:
      - abbr
  4. Run mkdocs serve
  5. Open the page in a browser

Expected Behavior

When hovering over the "HTML" text, a tooltip should appear showing "HyperText Markup Language".

Actual Behavior

The abbreviation syntax [HTML]: HyperText Markup Language is rendered as plain text without creating the expected tooltip functionality.

Browser

No response

Before submitting

@A3Bagged
Copy link

A3Bagged commented Dec 25, 2024

@leviofanh Downloaded and tested and turns out you had a false space before markdown-extensions: (not sure how they're called)

Wrong:
image

Right:
image

What i mean is there were 2 empty spaces before markdown-extensions: essentially putting it under theme:
markdown extensions need their own line, delete the 2 spaces and it works. Nothing faulty about the plugin, it was human error

If you're using VS Code there is a YAML extension that will show you the faults.
image

The [HTML]: HyperText Markup Language is the text that shows up

*[HTML]: HyperText Markup Language is essentially the "tooltip"

So the use case for it would be:

When hovering over the [HTML] tag you should see a tooltip.
*[HTML]: I am the tooltip

@squidfunk
Copy link
Owner

Thanks for investigating @A3Bagged – this is definitely related to a syntax error in the configuration.

@squidfunk squidfunk added the resolved by config change Issue can be mitigated by the reporter label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolved by config change Issue can be mitigated by the reporter
Projects
None yet
Development

No branches or pull requests

3 participants