enabled html rendering for message content

This commit is contained in:
David Mosbach 2023-05-28 18:37:06 +02:00
parent 5e46f0745b
commit a4dafe2365
2 changed files with 20 additions and 6 deletions

View File

@ -141,4 +141,18 @@ body {
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background: rgb(120, 120, 120); background: rgb(120, 120, 120);
}
a {
text-decoration: none;
color: rgb(75, 151, 151);
font-weight: 500;
}
a:hover {
color: rgb(90, 184, 184);
}
a:active {
color: rgb(110, 212, 212);
} }

View File

@ -53,17 +53,17 @@ class Message {
h = document.createElement('h3'); h = document.createElement('h3');
heading = document.createTextNode(this.fallbackLang); heading = document.createTextNode(this.fallbackLang);
h.appendChild(heading); h.appendChild(heading);
p = document.createElement('p'); p = document.createElement('html');
text = document.createTextNode(this.fallback); p.setAttribute('lang', this.fallbackLang);
p.appendChild(text); p.innerHTML = this.fallback;
result.push(h, p); result.push(h, p);
for (var t in this.translations) { for (var t in this.translations) {
h = document.createElement('h3'); h = document.createElement('h3');
heading = document.createTextNode(t); heading = document.createTextNode(t);
h.appendChild(heading); h.appendChild(heading);
p = document.createElement('p'); p = document.createElement('html');
text = document.createTextNode(this.translations[t]); p.setAttribute('lang', this.translations[t]);
p.appendChild(text); p.innerHTML = this.translations[t];
result.push(h, p); result.push(h, p);
} }
return result; return result;