forked from cwtch.im/ui
Merge branch 'htmlescape' of cwtch.im/ui into master
This commit is contained in:
commit
1c9bb47083
|
@ -9,6 +9,7 @@ import "fonts/Twemoji.js" as T
|
|||
import "overlays"
|
||||
import "panes"
|
||||
import "widgets"
|
||||
import "utils.js" as Utils
|
||||
|
||||
Item {
|
||||
id: windowItem
|
||||
|
@ -27,7 +28,7 @@ Item {
|
|||
T.twemoji.ext = ".png"
|
||||
T.twemoji.size = "72x72"
|
||||
T.twemoji.className = "\" height=\""+size+"\" width=\""+size
|
||||
return T.twemoji.parse(text)
|
||||
return T.twemoji.parse(Utils.htmlEscaped(text))
|
||||
}
|
||||
|
||||
function restoreEmoji(text) { // REPLACE <IMG> TAGS WITH EMOJI
|
||||
|
|
|
@ -7,6 +7,7 @@ import QtQuick.Layouts 1.3
|
|||
import "../widgets"
|
||||
import "../widgets/controls" as Awesome
|
||||
import "../fonts/Twemoji.js" as T
|
||||
import "../utils.js" as Utils
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
|
@ -46,7 +47,7 @@ ColumnLayout {
|
|||
"_handle": handle,
|
||||
"_from": from,
|
||||
"_displayName": displayName,
|
||||
"_message": parse(msg.d, 12),
|
||||
"_message":parse(msg.d, 12),
|
||||
"_image": image,
|
||||
"_mid": mid,
|
||||
"_fromMe": fromMe,
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
.pragma library
|
||||
|
||||
function htmlEscaped(str) {
|
||||
str = str.replace(/&/g, "&");
|
||||
str = str.replace(/</g, "<");
|
||||
str = str.replace(/>/g, ">");
|
||||
str = str.replace(/"/g, """);
|
||||
str = str.replace(/'/g, "'");
|
||||
return str
|
||||
}
|
Loading…
Reference in New Issue