Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-libclient
Commits
97da6447
Unverified
Commit
97da6447
authored
Nov 12, 2019
by
Sébastien Blin
Browse files
Options
Downloads
Patches
Plain Diff
chatview: fix emoji display in gtkwebkit
Change-Id: I4437cc4dbb8b5e40914a6c9953bf22492a3899ab
parent
791be6c8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/web-chatview/chatview.js
+16
-1
16 additions, 1 deletion
src/web-chatview/chatview.js
with
16 additions
and
1 deletion
src/web-chatview/chatview.js
+
16
−
1
View file @
97da6447
...
@@ -706,6 +706,17 @@ function youtube_id(url) {
...
@@ -706,6 +706,17 @@ function youtube_id(url) {
return
(
match
&&
match
[
2
].
length
==
11
)
?
match
[
2
]
:
null
return
(
match
&&
match
[
2
].
length
==
11
)
?
match
[
2
]
:
null
}
}
/**
* Emojis in a <pre> without <b> can disappears in a gtk webkit container
* So for now, use this workaround.
*/
function
replace_emojis
(
text
)
{
let
emojis_regex
=
/
(?:[\u
2700-
\u
27bf
]
|
(?:\u
d83c
[\u
dde6-
\u
ddff
]){2}
|
[\u
d800-
\u
dbff
][\u
dc00-
\u
dfff
])[\u
fe0e
\u
fe0f
]?(?:[\u
0300-
\u
036f
\u
fe20-
\u
fe23
\u
20d0-
\u
20f0
]
|
\u
d83c
[\u
dffb-
\u
dfff
])?(?:\u
200d
(?:[^\u
d800-
\u
dfff
]
|
(?:\u
d83c
[\u
dde6-
\u
ddff
]){2}
|
[\u
d800-
\u
dbff
][\u
dc00-
\u
dfff
])[\u
fe0e
\u
fe0f
]?(?:[\u
0300-
\u
036f
\u
fe20-
\u
fe23
\u
20d0-
\u
20f0
]
|
\u
d83c
[\u
dffb-
\u
dfff
])?)
*/g
text
=
text
.
replace
(
emojis_regex
,
(
emoji
)
=>
"
</pre><b>
"
+
emoji
+
"
</b><pre>
"
)
return
text
}
/**
/**
* Returns HTML message from the message text, cleaned and linkified.
* Returns HTML message from the message text, cleaned and linkified.
* @param message_text
* @param message_text
...
@@ -716,7 +727,11 @@ function getMessageHtml(message_text) {
...
@@ -716,7 +727,11 @@ function getMessageHtml(message_text) {
var
linkified_message
=
linkifyHtml
(
escaped_message
,
linkifyOptions
)
// eslint-disable-line no-undef
var
linkified_message
=
linkifyHtml
(
escaped_message
,
linkifyOptions
)
// eslint-disable-line no-undef
const
textPart
=
document
.
createElement
(
"
pre
"
)
const
textPart
=
document
.
createElement
(
"
pre
"
)
if
(
use_qt
)
{
textPart
.
innerHTML
=
linkified_message
textPart
.
innerHTML
=
linkified_message
}
else
{
textPart
.
innerHTML
=
replace_emojis
(
linkified_message
)
}
return
textPart
.
outerHTML
return
textPart
.
outerHTML
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment