Skip to content

Remove horizontal trimming from libsyntax::parse::comments::strip_doc_comment_decoration #7135

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
wants to merge 2 commits into from

Conversation

SiegeLord
Copy link
Contributor

The bug this commit fixes manifests itself when you use the single line doc comments and indented code blocks, e.g. like so:

///~~~
///{
///   a;
///}
///~~~

The resultant markdown code with the current code would look like this:

{
a;
}

See, e.g., http://static.rust-lang.org/doc/std/iterator.html#example-12.

I also removed the horizontal trimming from the block doc comments too, to be consistent. The unindent_pass in librustdoc does a fine job taking care of leading white space.

…_comment_decoration.

This change prevents the indentation in code blocks inside the /// doc comments
from being eaten. The indentation that is the same across the consecutive doc
comments is removed by the uindent_pass in librustdoc.
@SiegeLord SiegeLord closed this Jun 16, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 21, 2021
Cover `Result` for `question_mark`

closes rust-lang#7135

changelog: [`question_mark`] now covers `Result`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant