Allow copying text from non-message events

This commit is contained in:
miruka
2020-03-27 04:58:49 -04:00
parent 936c49127d
commit 3f69710813
2 changed files with 20 additions and 9 deletions

View File

@@ -163,13 +163,19 @@ QtObject {
}
function escapeHtml(string) {
function escapeHtml(text) {
// Replace special HTML characters by encoded alternatives
return string.replace("&", "&")
.replace("<", "&lt;")
.replace(">", "&gt;")
.replace('"', "&quot;")
.replace("'", "&#039;")
return text.replace("&", "&amp;")
.replace("<", "&lt;")
.replace(">", "&gt;")
.replace('"', "&quot;")
.replace("'", "&#039;")
}
function stripHtmlTags(text) {
// XXX: Potentially unsafe!
return text.replace(/<\/?[^>]+(>|$)/g, "")
}