-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
attr_list
values are included in social card's title, if set for h1 header
#7913
Comments
Thanks for reporting. So, I've investigated, and it seems that this comes from MkDocs mutating the We can mitigate the issue on our side by switching to IMHO, this is misleading, as the same property has different values depending on the hook used, and must thus be fixed in MkDocs. It tries to do a best effort to return any title, not carrying about the specifics. Since this possibly impacts a lot of plugins, may I kindly ask you to create an upstream issue? Here's a hook with a minimal reproduction: def on_page_markdown(markdown, page, config, files):
print("on_page_markdown", page.title)
def on_page_content(html, page, config, files):
print("on_page_content", page.title)
|
Note that inconsistent title handling is one of the major pain points of MkDocs:
The first issue is the second-most commented issue for MkDocs, but IMHO, it is still unfixed albeit the issue being closed, so I think the maintainers will probably tackle this as part of the next iteration of MkDocs they are currently working on. It might be good for them to know a few other corner cases that break, including this one, so reporting it could be beneficial. |
Released as part of 9.5.50. |
Context
No response
Bug description
When using the
attr_list
extension alongside the Social plugin and then set a attribute for theh1
header (i.e. a custom header ID) does the social plugin include the attribute in the title of the image.Example (From reproduction):
Resulting card:

Related links
Reproduction
9.5.49-social-cards-display-issue.zip
Steps to reproduce
social
to the plugins optionattr_list
to the markdown_extensions optionBrowser
Firefox
Before submitting
The text was updated successfully, but these errors were encountered: