-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
regression: rustdoc interprets the *
in /** */
doc comments as literal Markdown
#92872
Comments
The docs for the MCVE render with an itemized bullet at the top of the page on nightly, but not on stable. I think this is why replacing the |
*
in /** */
doc comments as literal Markdown
The |
@GuillaumeGomez They actually haven't always been like this; this is a regression. On stable, it looks like this: |
Interesting. How did we make the difference between: /**
hello
* list
* list
and: /**
* hello
* * list
* * list
*/ ? Do we need to have a star at each line or something? |
I'm not sure exactly how it works, but I believe it's handled by this code (the code modified by the regressing PR, though I'm not sure how it caused the regression): https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/util/comments/fn.beautify_doc_string.html |
It's because we stopped trimming the beginning and the end of the doc comments to prevent bugs when different doc comment kinds are merged. I'm fixing it. |
…r=notriddle Fix star handling in block doc comments Fixes rust-lang#92872. Some extra explanation about this PR and why rust-lang#92357 created this regression: when we merge doc comment kinds for example in: ```rust /// he /** * hello */ #[doc = "boom"] ``` We don't want to remove the empty lines between them. However, to correctly compute the "horizontal trim", we still need it, so instead, I put back a part of the "vertical trim" directly in the "horizontal trim" computation so it doesn't impact the output buffer but allows us to correctly handle the stars. r? ``@camelid``
Code
I tried this code:
When I run
cargo test
, I getOddly it doesn't fail with
/**
replaced by///
.This worked on
rust version 1.60.0-nightly (092e1c9d2 2022-01-09)
but failed onrust version 1.60.0-nightly (1409c015b 2022-01-11)
The text was updated successfully, but these errors were encountered: