Improve html2text function + Fix css nth-child not numbered correctly

This commit is contained in:
Bofh 2022-12-17 23:04:31 +01:00
parent 64b60f33f2
commit 727fdd5ac6
2 changed files with 6 additions and 4 deletions

View File

@ -228,7 +228,7 @@ table.fields tr.verified td .fa.fa-check::before {
margin-top: .5em;
word-break: break-all;
}
.item table.fields tr > td:nth-child(1) {
.item table.fields tr > td:nth-child(2) {
word-break: break-all;
}
.item.suspended .card {

View File

@ -137,12 +137,14 @@ function isVisible(element) {
}
function html2text(html) {
html = html.replaceAll('>', '> ');
html = html.replace(/<\/(p|div|br)\/?>/g, function (m){ return m+'&nbsp;' });
html = html.replace(/\s+/g, ' ');
var e = document.createElement('div');
e.innerHTML = html;
const result = e.innerText;
var result = e.innerText;
result = result.replace(/\s+/g, ' ');
e.remove();
return result;
return result.trim();
}
function JSON_to_URLEncoded(element,key,list) {