Debanjana Sarkar 3 年之前
父节点
当前提交
7f99b24e28
共有 3 个文件被更改,包括 12 次插入3 次删除
  1. 3 2
      CHANGES.md
  2. 8 0
      src/plugins/chatview/tests/styling.js
  3. 1 1
      src/shared/styling.js

+ 3 - 2
CHANGES.md

@@ -11,9 +11,10 @@
 - Don't apply message corrections when the MUC occupant-id doesn't match.
 - Update `nick` attribute on ChatRoom when user nickname changes
 - Restrict editing of MUC messages to ones with the same XEP-0421 occupant ID
-- #2936: Fix documentation about enable_smacks option, which is true by default.
+- #2870: Fix for multiple URLs to be linkified when sent together in chat and adds a test for this.
 - #2925: Fix missing disco-items in browser storage.
-- Fix MUC messages with a fallback body not rendering.
+- #2936: Fix documentation about enable_smacks option, which is true by default.
+- #3005: Fix MUC messages with a fallback body not rendering.
 
 ## 9.1.1 (2022-05-05)
 

+ 8 - 0
src/plugins/chatview/tests/styling.js

@@ -242,6 +242,14 @@ describe("An incoming chat Message", function () {
         await mock.openChatBoxFor(_converse, contact_jid);
         const view = _converse.chatboxviews.get(contact_jid);
 
+        msg_text = `> https://conversejs.org\n> https://conversejs.org`;
+        msg = mock.createChatMessage(_converse, contact_jid, msg_text)
+        await _converse.handleMessageStanza(msg);
+        await u.waitUntil(() => view.querySelectorAll('.chat-msg__text').length === 1);
+        msg_el = Array.from(view.querySelectorAll('converse-chat-message-body')).pop();
+        await u.waitUntil(() => msg_el.innerHTML.replace(/<!-.*?->/g, '') ===
+            '<blockquote><a target="_blank" rel="noopener" href="https://conversejs.org/">https://conversejs.org</a> \n <a target="_blank" rel="noopener" href="https://conversejs.org/">https://conversejs.org</a></blockquote>');
+
         msg_text = `> This is quoted text\n>This is also quoted\nThis is not quoted`;
         msg = mock.createChatMessage(_converse, contact_jid, msg_text)
         await _converse.handleMessageStanza(msg);

+ 1 - 1
src/shared/styling.js

@@ -145,7 +145,7 @@ export function getDirectiveTemplate (d, text, offset, options) {
     const template = styling_templates[styling_map[d].name];
     if (isQuoteDirective(d)) {
         const newtext = text
-            .replace(/\n>/g, '\n') // Don't show the directive itself
+            .replace(/\n>/g, ' \n') // Don't show the directive itself
             .replace(/\n$/, ''); // Trim line-break at the end
         return template(newtext, offset, options);
     } else {