-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rustdoc: DOS line endings cause extra newlines to show up in source view #76361
Comments
Could be related to |
I set |
Try adding |
Thanks Andy, I tried tesuji/junction@c8107d0 as you told but still the issue remains. |
Oh, I meant for the source files, you might need to reconfigure git before checking out the source (and that's likely just a workaround, this seems likely to be a bug in rustdoc's handling of |
Thank you, problem is solved in tesuji/junction@005a79c . You could close this issue if you see fit. |
(keywords cause I keep failing to search for this: dos line endings) |
The issue is that <span class="doccomment">/// Additional docs
</span>
<!-- this next line ends with \r, not \n -->
<span class="doccomment">///
</span>
<span class="doccomment">/// [LLVM commit D20468][https://reviews.llvm.org/D20468]
</span> |
I guess this means rust/src/librustdoc/html/highlight.rs Lines 169 to 171 in 7504256
|
|
This is not actually correct - it was a blank line in the original source code. The issue is that rustdoc used to strip <span class="doccomment">/// Additional docs</span>
<span class="doccomment">///</span>
<span class="doccomment">/// [LLVM commit D20468][https://reviews.llvm.org/D20468]</span> and 1.48: </pre><div class="example-wrap"><pre class="rust ">
<span class="doccomment">/// Additional docs
</span>
<span class="doccomment">///
</span>
<span class="doccomment">/// [LLVM commit D20468][https://reviews.llvm.org/D20468]
</span> |
…backline, r=jyn514 Ensure that the source code display is working with DOS backline Fixes rust-lang#76361. cc `@lzutao` r? `@jyn514`
…backline, r=jyn514 Ensure that the source code display is working with DOS backline Fixes rust-lang#76361. cc ``@lzutao`` r? ``@jyn514``
…backline, r=jyn514 Ensure that the source code display is working with DOS backline Fixes rust-lang#76361. cc ```@lzutao``` r? ```@jyn514```
I tried to document and publish my Windows crate to github pages.
Things went pretty smooth until I opened the source code view.
As you can see below, a newline is appended to each line doc comment,
also no line number for each line:
Here the render page on gh-pages: https://lzutao.github.io/junction/src/junction/lib.rs.html#1-111.
Beware that it has no version control for the generated doc. But the link here may work
for a limited time before github purge the cache: https://github.com/lzutao/junction/tree/6ab9e37b809afdb49fce1accf943250af6aa5dbf. Also here the the CI script I used:
https://github.com/lzutao/junction/blob/724dd2e564c76e4f92580629c2f4a1340875e890/.github/workflows/ci.yml#L62-L95.
The same code published on https://docs.rs is normal: https://docs.rs/junction/0.2.0/src/junction/lib.rs.html#1-111
Meta
rustc --version --verbose
: x86_64-pc-windows-msvc rustc 1.48.0-nightly (c59199e 2020-09-04)@rustbot modify labels: T-rustdoc
The text was updated successfully, but these errors were encountered: