Improve html2text function + Fix css nth-child not numbered correctly
This commit is contained in:
parent
64b60f33f2
commit
727fdd5ac6
|
@ -228,7 +228,7 @@ table.fields tr.verified td .fa.fa-check::before {
|
||||||
margin-top: .5em;
|
margin-top: .5em;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
.item table.fields tr > td:nth-child(1) {
|
.item table.fields tr > td:nth-child(2) {
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
.item.suspended .card {
|
.item.suspended .card {
|
||||||
|
|
|
@ -137,12 +137,14 @@ function isVisible(element) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function html2text(html) {
|
function html2text(html) {
|
||||||
html = html.replaceAll('>', '> ');
|
html = html.replace(/<\/(p|div|br)\/?>/g, function (m){ return m+' ' });
|
||||||
|
html = html.replace(/\s+/g, ' ');
|
||||||
var e = document.createElement('div');
|
var e = document.createElement('div');
|
||||||
e.innerHTML = html;
|
e.innerHTML = html;
|
||||||
const result = e.innerText;
|
var result = e.innerText;
|
||||||
|
result = result.replace(/\s+/g, ' ');
|
||||||
e.remove();
|
e.remove();
|
||||||
return result;
|
return result.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
function JSON_to_URLEncoded(element,key,list) {
|
function JSON_to_URLEncoded(element,key,list) {
|
||||||
|
|
Loading…
Reference in New Issue