Uh oh!
There was an error while loading. Please reload this page.
Allow # to appear in rustdoc code output. - #41785
Conversation
rust-highfive
commented
May 6, 2017
(rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
If there's a better way to do this, I'd be happy to hear about it.
GuillaumeGomez
commented
May 6, 2017
Ok, so it seems to be a good idea but I don't agree with how you implemented it or the idea of the feature. From my point of view, if a line starts with |
74b29b6 to
ba840c5CompareThere was a problem hiding this comment.
This code won't work, switch the two conditions.
There was a problem hiding this comment.
Err, that was a mistake either way, it should be "# ".
There was a problem hiding this comment.
Something more intelligent in here could be to put this if condition after the next one, and replace starts_with("# ") with starts_with("#"). So you can write:
#extern crate foo;
As well as:
# extern crate foo;
"##" at the start of a trimmed rustdoc line is now cut to "#" and then shown. If the user wanted to show "##", they can type "###".
Mark-Simulacrum
commented
May 7, 2017
I wasn't able to make |
GuillaumeGomez
commented
May 7, 2017
Well, it could be a future improvement. We'll see. For now it's good, thanks! @bors: r+ |
bors
commented
May 7, 2017
📌 Commit ffe12b1 has been approved by |
bors
commented
May 7, 2017
Allow # to appear in rustdoc code output. "##" at the start of a trimmed rustdoc line is now cut to "#" and then shown. If the user wanted to show "##", they can type "###". I'm somewhat concerned about the potential implications for users, since this does make a potentially backwards-incompatible change. Previously, `##` had no special handling, and now we do change it. However, I'm not really sure what we can do here to improve this, and I can't think of any cases where `##` would likely be correct in a code block, though of course I could be wrong. Fixes#41783.
bors
commented
May 7, 2017
☀️ Test successful - status-appveyor, status-travis |
"##" at the start of a trimmed rustdoc line is now cut to "#" and then
shown. If the user wanted to show "##", they can type "###".
I'm somewhat concerned about the potential implications for users, since this does make a potentially backwards-incompatible change. Previously,
##had no special handling, and now we do change it. However, I'm not really sure what we can do here to improve this, and I can't think of any cases where##would likely be correct in a code block, though of course I could be wrong.Fixes#41783.