-
Notifications
You must be signed in to change notification settings - Fork 234
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
A new broken link callback design #469
A new broken link callback design #469
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if there's anything I can do to help with this :) I'd love to have these fixed before intra-doc links (hopefully) stabilize in 6 weeks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally this looks good, suggestions for minor fixes inline. I understand this is a (minorly) breaking change and we'll want to bump semver?
a726d6c
to
f2c8906
Compare
Sending a big thank to @jyn514, @euclio and @raphlinus for the feedback! Edit: And yes, this will require a semver breaking change bump. |
This is awesome, thank you @marcusklaas! Now I just need to update |
Thanks to marcusklaas' hard work in pulldown-cmark/pulldown-cmark#469, this fixes a lot of rustdoc bugs! - Get rid of unnecessary `RefCell` - Fix duplicate warnings for broken implicit reference link - Remove unnecessary copy of links
…Gomez Upgrade to pulldown-cmark 0.8.0 Thanks to marcusklaas' hard work in pulldown-cmark/pulldown-cmark#469, this fixes a lot of rustdoc bugs! - Get rid of unnecessary `RefCell` - Fix duplicate warnings for broken implicit reference link - Remove unnecessary copy of links Closes rust-lang#73264, closes rust-lang#76687. r? @euclio I'm not sure if the switch away from `locate` fixes any open bugs - euclio mentioned some in pulldown-cmark/pulldown-cmark#165, but I didn't see any related issues open for rustdoc. Let me know if I missed one.
This is a
WIPPR to address several outstanding issues with the current broken link callback design.Firstly, it provides additional data (source mapping, link type) to the callback to improve diagnostics (#373) and help disambiguate links with identical references (#165). Further, this design also prevents the callback from being called twice on the same reference (#444). And lastly, the callback now returns
CowStr
s, so that it is possible to generate titles and urls without memory allocations, for example when they are static strings or derived from text in the source.Feedback is greatly appreciated. Would this cover your use-cases? Is this an improvement over the old design?
cc @euclio @jyn514 @GuillaumeGomez