Skip to content
\n
    \n
  1. abbreviation{ title=\"Important information\" } doesn't create any HTML element for attr_list to use. abbreviation is a pure string without a wrapper to target the addition of attributes. You can fix it using a span wrapper of your own above with set attributes without using attr_list, or any other wrapper *abbreviation*{ title=\"Important information\" }
  2. \n
","upvoteCount":1,"url":"https://github.com/squidfunk/mkdocs-material/discussions/8208#discussioncomment-13083797"}}}

Attribute list #8208

Answered by kamilkrzyskow
NFanoe asked this question in Q&A
May 7, 2025 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Hello @NFanoe,
I'm not entirely sure what you're trying to do, but since you use the title attribute, then I'll assume you want to enable tooltips for elements.

attr_list is a Markdown extension, which adds attributes to HTML blocks generated in Markdown.

  1. :material-information-outline:{ title="Important information" } works because the pymdownx.emoji markdown extension generates a HTML <span> wrapper for the icon, which later is used by the attr_list

  2. <span>abbreviation</span>{ title="Important information" } doesn't work, because it's a raw HTML element not passed to the attr_list extension or any other extension, it's used as-is. You can fix it by adding your own attributes to the <s…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@NFanoe
Comment options

@kamilkrzyskow
Comment options

@frammenti
Comment options

@kamilkrzyskow
Comment options

Answer selected by NFanoe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants