Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
14aa6a9c
Commit
14aa6a9c
authored
Mar 10, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/scripts/Utils/utils): `encodeTextToQmlRichFormat` supports tab/spaces correctly
parent
1a32b397
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
Message.qml
linphone-desktop/ui/modules/Linphone/Chat/Message.qml
+1
-1
utils.js
linphone-desktop/ui/scripts/Utils/utils.js
+2
-4
No files found.
linphone-desktop/ui/modules/Linphone/Chat/Message.qml
View file @
14aa6a9c
...
...
@@ -59,7 +59,7 @@ Item {
// See http://doc.qt.io/qt-5/qml-qtquick-text.html#textFormat-prop
// and http://doc.qt.io/qt-5/richtext-html-subset.html
textFormat
:
Text
.
RichText
// To supports links and imgs.
wrapMode
:
TextEdit
.
Wrap
wrapMode
:
TextEdit
.
W
ordW
rap
onCursorRectangleChanged
:
Logic
.
ensureVisible
(
cursorRectangle
)
onLinkActivated
:
Qt
.
openUrlExternally
(
link
)
...
...
linphone-desktop/ui/scripts/Utils/utils.js
View file @
14aa6a9c
...
...
@@ -50,9 +50,7 @@ function encodeTextToQmlRichFormat (text, options) {
var
formattedText
=
execAll
(
UriTools
.
URI_REGEX
,
text
,
function
(
str
,
valid
)
{
if
(
!
valid
)
{
return
unscapeHtml
(
str
).
replace
(
/
\r\n
|
\n
/g
,
'
<br/>
'
)
.
replace
(
/
\t
/g
,
'
'
)
.
replace
(
/ /g
,
'
'
)
return
unscapeHtml
(
str
)
}
var
uri
=
startsWith
(
str
,
'
www.
'
)
?
'
http://
'
+
str
:
str
...
...
@@ -76,7 +74,7 @@ function encodeTextToQmlRichFormat (text, options) {
images
=
'
<div>
'
+
images
+
'
</div>
'
}
return
images
.
concat
(
'
<p>
'
+
formattedText
+
'
</p>
'
)
return
images
.
concat
(
'
<p
style="white-space:pre-wrap;"
>
'
+
formattedText
+
'
</p>
'
)
}
function
extractFirstUri
(
str
)
{
...
...
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