Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
60331ce5 by wurstsalat at 2023-05-05T23:13:58+02:00
fix: Fix rendering of copied code blocks and quotes

Fixes #11499

- - - - -


1 changed file:

- gajim/gtk/menus.py


Changes:

=====================================
gajim/gtk/menus.py
=====================================
@@ -681,7 +681,13 @@ def get_chat_row_menu(contact: types.ChatContactT,
 
     format_string = app.settings.get('date_time_format')
     timestamp_formatted = timestamp.strftime(format_string)
-    copy_text = f'{timestamp_formatted} - {name}: {text}'
+
+    copy_text = f'{timestamp_formatted} - {name}: '
+    if text.startswith(('```', '> ')):
+        # Prepend a line break in order to keep code block/quotes rendering
+        copy_text += '\n'
+    copy_text += text
+
     menu_items.append(
         (p_('Message row action', 'Copy'),
          'win.copy-message',



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/60331ce5366a2754a3596511395e477e89cfe055

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/60331ce5366a2754a3596511395e477e89cfe055
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to