fix html output (newlines)

This commit is contained in:
Mark 2024-06-26 13:50:02 +02:00
parent 12d90a8022
commit 4c17fa1745
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "mers_lib" name = "mers_lib"
version = "0.8.17" version = "0.8.18"
edition = "2021" edition = "2021"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
description = "library to use the mers language in other projects" description = "library to use the mers language in other projects"

View File

@ -165,13 +165,13 @@ impl ThemeGen for HtmlDefaultTheme {
t.push_str("<span style=\"color:"); t.push_str("<span style=\"color:");
t.push_str(color); t.push_str(color);
t.push_str(";\">"); t.push_str(";\">");
html_escape::encode_text_to_string(text, t); self.nocolor(text, t);
t.push_str("</span>"); t.push_str("</span>");
} else { } else {
html_escape::encode_text_to_string(text, t); self.nocolor(text, t);
} }
} }
fn nocolor(&self, text: &str, t: &mut String) { fn nocolor(&self, text: &str, t: &mut String) {
t.push_str(text); t.push_str(html_escape::encode_text(text).replace("\n", "<br>\n"));
} }
} }