Merge lp:~seb128/messaging-app/display-lines-spaces into lp:messaging-app

Proposed by Sebastien Bacher
Status: Merged
Approved by: Tiago Salem Herrmann
Approved revision: 429
Merged at revision: 438
Proposed branch: lp:~seb128/messaging-app/display-lines-spaces
Merge into: lp:messaging-app
Diff against target: 15 lines (+3/-1)
1 file modified
src/qml/MessageBubble.qml (+3/-1)
To merge this branch: bzr merge lp:~seb128/messaging-app/display-lines-spaces
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+269220@code.launchpad.net

Commit message

display empty lines and leading spaces

Description of the change

display empty lines and leading spaces

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

tested on the device and works fine.
Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/MessageBubble.qml'
2--- src/qml/MessageBubble.qml 2015-08-17 17:39:45 +0000
3+++ src/qml/MessageBubble.qml 2015-08-26 14:34:09 +0000
4@@ -52,8 +52,10 @@
5 function parseText(text) {
6 // remove html tags
7 text = text.replace(/</g,'&lt;').replace(/>/g,'<tt>&gt;</tt>');
8+ // replace spaces
9+ text = text.replace(/ /g, '&nbsp;');
10 // replace line breaks
11- text = text.replace(/(\n)+/g, '<br />');
12+ text = text.replace(/\n/g, '<br />');
13 // check for links
14 var htmlText = BaLinkify.linkify(text);
15 if (htmlText !== text) {

Subscribers

People subscribed via source and target branches