Commit e5c030c1 authored by JC Brand's avatar JC Brand

Render max 2 newlines

parent 4361d0d6
......@@ -86946,7 +86946,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
};
u.renderNewLines = function (text) {
return text.replace(/\n+/g, '<br/>');
return text.replace(/\n\n+/g, '<br><br>').replace(/\n/g, '<br/>');
};
u.renderImageURLs = function (_converse, obj) {
......@@ -1091,7 +1091,7 @@
" <body>Hey\n\n\nHave you heard the news?</body>"+
"</message>").firstChild;
_converse.connection._dataRecv(test_utils.createRequest(stanza));
expect(chat_content.querySelector('.message:last-child .chat-msg-text').innerHTML).toBe('Hey<br>Have you heard the news?');
expect(chat_content.querySelector('.message:last-child .chat-msg-text').innerHTML).toBe('Hey<br><br>Have you heard the news?');
stanza = Strophe.xmlHtmlNode(
"<message from='"+contact_jid+"'"+
......
......@@ -223,7 +223,7 @@
};
u.renderNewLines = function (text) {
return text.replace(/\n+/g, '<br/>');
return text.replace(/\n\n+/g, '<br><br>').replace(/\n/g, '<br/>');
};
u.renderImageURLs = function (_converse, obj) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment