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
2a19553f
Commit
2a19553f
authored
Nov 29, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ui/scripts/Utils/utils): escape correclty special chars like &, \n, \t...
parent
9d44ccec
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
Message.qml
tests/ui/modules/Linphone/Chat/Message.qml
+1
-1
utils.js
tests/ui/scripts/Utils/utils.js
+5
-1
No files found.
tests/ui/modules/Linphone/Chat/Message.qml
View file @
2a19553f
...
@@ -61,7 +61,7 @@ Item {
...
@@ -61,7 +61,7 @@ Item {
padding
:
ChatStyle
.
entry
.
message
.
padding
padding
:
ChatStyle
.
entry
.
message
.
padding
readOnly
:
true
readOnly
:
true
selectByMouse
:
true
selectByMouse
:
true
text
:
Utils
.
encode
UrisToQml
Format
(
$chatEntry
.
content
,
{
text
:
Utils
.
encode
TextToQmlRich
Format
(
$chatEntry
.
content
,
{
imagesHeight
:
ChatStyle
.
entry
.
message
.
images
.
height
,
imagesHeight
:
ChatStyle
.
entry
.
message
.
images
.
height
,
imagesWidth
:
ChatStyle
.
entry
.
message
.
images
.
width
imagesWidth
:
ChatStyle
.
entry
.
message
.
images
.
width
})
})
...
...
tests/ui/scripts/Utils/utils.js
View file @
2a19553f
...
@@ -31,7 +31,7 @@ function connectOnce (signal, cb) {
...
@@ -31,7 +31,7 @@ function connectOnce (signal, cb) {
// -------------------------------------------------------------------
// -------------------------------------------------------------------
function
encode
UrisToQml
Format
(
text
,
options
)
{
function
encode
TextToQmlRich
Format
(
text
,
options
)
{
var
images
=
''
var
images
=
''
if
(
options
==
null
)
{
if
(
options
==
null
)
{
...
@@ -39,8 +39,12 @@ function encodeUrisToQmlFormat (text, options) {
...
@@ -39,8 +39,12 @@ function encodeUrisToQmlFormat (text, options) {
}
}
text
=
text
text
=
text
.
replace
(
/&/g
,
'
&
'
)
.
replace
(
/</g
,
'
\
u2063<
'
)
.
replace
(
/</g
,
'
\
u2063<
'
)
.
replace
(
/>/g
,
'
\
u2063>
'
)
.
replace
(
/>/g
,
'
\
u2063>
'
)
.
replace
(
/
\r\n
|
\n
/g
,
'
<br/>
'
)
.
replace
(
/
\t
/g
,
'
'
)
.
replace
(
/ /g
,
'
'
)
.
replace
(
UriTools
.
URI_REGEX
,
function
(
match
)
{
.
replace
(
UriTools
.
URI_REGEX
,
function
(
match
)
{
// If it's a simple URL, transforms it in URI.
// If it's a simple URL, transforms it in URI.
if
(
startsWith
(
match
,
'
www.
'
))
{
if
(
startsWith
(
match
,
'
www.
'
))
{
...
...
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