Render max 2 newlines
This commit is contained in:
parent
4361d0d66a
commit
e5c030c15a
2
dist/converse.js
vendored
2
dist/converse.js
vendored
@ -86946,7 +86946,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|||||||
};
|
};
|
||||||
|
|
||||||
u.renderNewLines = function (text) {
|
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) {
|
u.renderImageURLs = function (_converse, obj) {
|
||||||
|
@ -1091,7 +1091,7 @@
|
|||||||
" <body>Hey\n\n\nHave you heard the news?</body>"+
|
" <body>Hey\n\n\nHave you heard the news?</body>"+
|
||||||
"</message>").firstChild;
|
"</message>").firstChild;
|
||||||
_converse.connection._dataRecv(test_utils.createRequest(stanza));
|
_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(
|
stanza = Strophe.xmlHtmlNode(
|
||||||
"<message from='"+contact_jid+"'"+
|
"<message from='"+contact_jid+"'"+
|
||||||
|
@ -223,7 +223,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
u.renderNewLines = function (text) {
|
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) {
|
u.renderImageURLs = function (_converse, obj) {
|
||||||
|
Loading…
Reference in New Issue
Block a user