[fractal/markdown-newlines: 5/5] message: add `<br>` for newlines
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal/markdown-newlines: 5/5] message: add `<br>` for newlines
- Date: Sat, 12 Oct 2019 10:32:03 +0000 (UTC)
commit 2f65437657d1a93cd27a67bf50f0b938db729848
Author: Alexandre Franke <afranke gnome org>
Date: Sun Sep 29 11:23:20 2019 +0200
message: add `<br>` for newlines
fractal-gtk/src/appop/message.rs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/fractal-gtk/src/appop/message.rs b/fractal-gtk/src/appop/message.rs
index dd7fcbf3..1e8f872e 100644
--- a/fractal-gtk/src/appop/message.rs
+++ b/fractal-gtk/src/appop/message.rs
@@ -203,7 +203,9 @@ impl AppOp {
// Riot does not properly show emotes with Markdown;
// Emotes with markdown have a newline after the username
if m.mtype != "m.emote" && self.md_enabled {
- let mut md_parsed_msg = markdown_to_html(&msg, &ComrakOptions::default());
+ let mut md_options = ComrakOptions::default();
+ md_options.hardbreaks = true;
+ let mut md_parsed_msg = markdown_to_html(&msg, &md_options);
// Removing wrap tag: <p>..</p>\n
let limit = md_parsed_msg.len() - 5;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]