Skip to content

Commit

Permalink
Fix for #2870
Browse files Browse the repository at this point in the history
  • Loading branch information
debanjana-a11y authored and jcbrand committed Aug 15, 2022
1 parent 17e5804 commit 7f99b24
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 8 additions & 0 deletions src/plugins/chatview/tests/styling.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/styling.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7f99b24

Please sign in to comment.