mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-08 12:46:08 +00:00
21 lines
572 B
QML
21 lines
572 B
QML
pragma Singleton
|
|
|
|
import QtQuick 2.13
|
|
import "./twemoji/twemoji.js" as Twemoji
|
|
|
|
QtObject {
|
|
property string base: Qt.resolvedUrl("twemoji/")
|
|
function parse(text, size) {
|
|
Twemoji.twemoji.base = base
|
|
Twemoji.twemoji.ext = ".png"
|
|
Twemoji.twemoji.size = size
|
|
return Twemoji.twemoji.parse(text)
|
|
}
|
|
function fromCodePoint(value) {
|
|
return Twemoji.twemoji.convert.fromCodePoint(value)
|
|
}
|
|
function deparse(value){
|
|
return value.replace(/<img src=\"qrc:\/imports\/twemoji\/.+?" alt=\"(.+?)\" \/>/g, "$1");
|
|
}
|
|
}
|