Render max 2 newlines

This commit is contained in:
JC Brand 2018-06-30 16:15:27 +02:00
parent 4361d0d66a
commit e5c030c15a
3 changed files with 3 additions and 3 deletions

2
dist/converse.js vendored
View File

@ -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) {

View File

@ -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+"'"+

View File

@ -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) {