Ensure that the source code display is working with DOS backline

This commit is contained in:
Guillaume Gomez 2020-10-14 17:02:04 +02:00
parent 12f0dba618
commit 1861a38ca9

View File

@ -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 {