[fractal/markdown-newlines] message: add `<br>` for newlines



commit 3dd4ec4edb69aae0294278b5921728be06c63b48
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]