Skip to content

bug: deprecation warning with latest mkdocstrings and autorefs #6

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

Closed
mschoettle opened this issue Sep 6, 2024 · 3 comments · Fixed by #7
Closed

bug: deprecation warning with latest mkdocstrings and autorefs #6

mschoettle opened this issue Sep 6, 2024 · 3 comments · Fixed by #7
Assignees
Labels
unconfirmed This bug was not reproduced yet

Comments

@mschoettle
Copy link
Contributor

Description of the bug

The following deprecation warning gets output with the latest mkdocstrings version:

https://github.com/mkdocstrings/autorefs/blob/40940c591e9cc557573ccd35351ca2b535ec371b/src/mkdocs_autorefs/references.py#L274-L279

I am aware that this is the legacy Python handler. Despite that, is there still interest in having this fixed?

@mschoettle mschoettle added the unconfirmed This bug was not reproduced yet label Sep 6, 2024
@pawamoy
Copy link
Member

pawamoy commented Sep 6, 2024

Yes, this should be fixed! Thanks for reporting.

@mschoettle
Copy link
Contributor Author

Great!

I tried replacing this here:

return Markup("<span data-autorefs-optional-hover={path}>{brief}</span>").format(path=path, brief=brief)

with:

return Markup("<autorefs optional-hover={path}>{brief}</autorefs>").format(path=path, brief=brief)

It fixes the warning, not sure if it's correct though. A quick comparison of some rendered output seems to be identical.

If that looks good I can create a PR.

@pawamoy
Copy link
Member

pawamoy commented Sep 6, 2024

It should be this:

return Markup("<autoref identifier={path} optional hover>{brief}</autoref>").format(path=path, brief=brief)

PR welcome! I should be able to review+merge+release tomorrow :)

@pawamoy pawamoy closed this as completed in #7 Sep 7, 2024
pawamoy added a commit that referenced this issue Sep 7, 2024
Issue-6: #6
PR-7: #7
Co-authored-by: Timothée Mazzucotelli <dev@pawamoy.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed This bug was not reproduced yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants