Skip to content

Commit

Permalink
Ensure that the source code display is working with DOS backline
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez authored and pietroalbini committed Nov 17, 2020
1 parent 2f3b6e1 commit f7886a6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librustdoc/html/highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ pub fn render_with_highlighting(
playground_button: Option<&str>,
tooltip: Option<(&str, &str)>,
) -> String {
// This replace allows to fix how the code source with DOS backline characters is displayed.
let src = src.replace("\r\n", "\n");
debug!("highlighting: ================\n{}\n==============", src);
let mut out = String::with_capacity(src.len());
if let Some((tooltip, class)) = tooltip {
Expand Down

0 comments on commit f7886a6

Please sign in to comment.