Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
e5c030c1
Commit
e5c030c1
authored
Jun 30, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Render max 2 newlines
parent
4361d0d6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
dist/converse.js
dist/converse.js
+1
-1
spec/messages.js
spec/messages.js
+1
-1
src/utils/core.js
src/utils/core.js
+1
-1
No files found.
dist/converse.js
View file @
e5c030c1
...
@@ -86946,7 +86946,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -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) {
spec/messages.js
View file @
e5c030c1
...
@@ -1091,7 +1091,7 @@
...
@@ -1091,7 +1091,7 @@
"
<body>Hey
\n\n\n
Have you heard the news?</body>
"
+
"
<body>Hey
\n\n\n
Have 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
+
"
'
"
+
...
...
src/utils/core.js
View file @
e5c030c1
...
@@ -223,7 +223,7 @@
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment