Skip to content
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

Ensure that the source code display is working with DOS backline #77939

Merged
merged 2 commits into from
Nov 17, 2020

Conversation

GuillaumeGomez
Copy link
Member

Fixes #76361.

cc @lzutao
r? @jyn514

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 14, 2020
@GuillaumeGomez
Copy link
Member Author

I just wonder about something: should I make this replace in the string function in the same file instead?

@jyn514 jyn514 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Oct 14, 2020
@jyn514
Copy link
Member

jyn514 commented Oct 14, 2020

I don't understand why this would fix the problem. Why is \r\n currently broken? #76361 says that it is but not why it's going wrong, I'd rather fix the root cause.

@GuillaumeGomez
Copy link
Member Author

You gave me an idea. I'll check it out later.

@jyn514 jyn514 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 15, 2020
@GuillaumeGomez GuillaumeGomez added the A-rustdoc-ui Area: rustdoc UI (generated HTML) label Oct 16, 2020
@crlf0710 crlf0710 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 6, 2020
@GuillaumeGomez
Copy link
Member Author

The idea didn't work out unfortunately... So I think the current PR is as good as I can think.

@GuillaumeGomez GuillaumeGomez added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 13, 2020
@jyn514
Copy link
Member

jyn514 commented Nov 13, 2020

@GuillaumeGomez do you know why \r\n currently breaks the rendering in the browser? I think we discussed it on Discord a while ago, but I don't remember the answer.

@GuillaumeGomez
Copy link
Member Author

Because "\r\n" is considered as two backlines. :)

Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me with a test added; please make sure it fails before and succeeds after.

src/librustdoc/html/highlight.rs Outdated Show resolved Hide resolved
@jyn514 jyn514 added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Nov 15, 2020
@GuillaumeGomez
Copy link
Member Author

Add the test.

@GuillaumeGomez
Copy link
Member Author

@bors: r=jyn514

@bors
Copy link
Contributor

bors commented Nov 15, 2020

📌 Commit 0c52044 has been approved by jyn514

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 15, 2020
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 15, 2020
…backline, r=jyn514

Ensure that the source code display is working with DOS backline

Fixes rust-lang#76361.

cc `@lzutao`
r? `@jyn514`
@GuillaumeGomez GuillaumeGomez added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Nov 16, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 16, 2020
Rust 1.48.0 stable release

This PR bumps the 1.48 beta branch to the 1.48 stable branch, and applies these last minute backports:

* rust-lang#77939 - Ensure that the source code display is working with DOS backline
* rust-lang#77508 - Fix capitalization in blog post name
* rust-lang#78559 - Add LLVM upgrades from 7 to 10 to RELEASES.md
* rust-lang#78364 - Update RELEASES.md for 1.48.0

r? `@ghost`
cc `@rust-lang/release`
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 16, 2020
…backline, r=jyn514

Ensure that the source code display is working with DOS backline

Fixes rust-lang#76361.

cc ``@lzutao``
r? ``@jyn514``
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 17, 2020
…backline, r=jyn514

Ensure that the source code display is working with DOS backline

Fixes rust-lang#76361.

cc ```@lzutao```
r? ```@jyn514```
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 17, 2020
Rollup of 9 pull requests

Successful merges:

 - rust-lang#77939 (Ensure that the source code display is working with DOS backline)
 - rust-lang#78138 (Upgrade dlmalloc to version 0.2)
 - rust-lang#78967 (Make codegen tests compatible with extra inlining)
 - rust-lang#79027 (Limit storage duration of inlined always live locals)
 - rust-lang#79077 (document that __rust_alloc is also magic to our LLVM fork)
 - rust-lang#79088 (clarify `span_label` documentation)
 - rust-lang#79097 (Code block invalid html tag lint)
 - rust-lang#79105 (std: Fix test `symlink_hard_link` on Windows)
 - rust-lang#79107 (build-manifest: strip newline from rustc version)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@pietroalbini pietroalbini removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Nov 17, 2020
@bors bors merged commit cf34956 into rust-lang:master Nov 17, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 17, 2020
@GuillaumeGomez GuillaumeGomez deleted the fix-source-code-dos-backline branch November 17, 2020 12:08
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Nov 17, 2020
Get rid of `highlight::Class::None`

This is mostly me learning the codebase for rust-lang#77939, so feel free to close the PR.
It does have the small benefit that we statically know rustdoc isn't generating useless `span`s, though.

r? `@GuillaumeGomez`
cc `@matklad`
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 18, 2020
…crum

Prepare beta 1.49.0

This PR sets everything up for beta 1.49.0, and backports the following PRs to it:

* rust-lang#79107 - build-manifest: strip newline from rustc version
* rust-lang#78986 - Avoid installing external LLVM dylibs
* rust-lang#79074 - Install CI llvm into the library directory
* rust-lang#78364 - Update RELEASES.md for 1.48.0
* rust-lang#77939 - Ensure that the source code display is working with DOS backline

r? `@ghost`
cc `@rust-lang/release`
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 18, 2020
Actually prepare beta 1.49.0

This PR sets everything up for beta 1.49.0, and backports the following PRs to it:

* rust-lang#79107 - build-manifest: strip newline from rustc version
* rust-lang#78986 - Avoid installing external LLVM dylibs
* rust-lang#79074 - Install CI llvm into the library directory
* rust-lang#78364 - Update RELEASES.md for 1.48.0
* rust-lang#77939 - Ensure that the source code display is working with DOS backline

This is the same as rust-lang#79132, but actually targeting the right branch.

r? `@ghost`
cc `@rust-lang/release`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: rustdoc UI (generated HTML) beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc: DOS line endings cause extra newlines to show up in source view
7 participants