Fix some "<br/>" was not being translated correctly

This commit is contained in:
Bofh 2022-12-24 18:29:41 +01:00
parent 81b21d838f
commit d5a961ce64
1 changed files with 2 additions and 1 deletions

View File

@ -137,7 +137,8 @@ function isVisible(element) {
}
function html2text(html) {
html = html.replace(/<\/(p|div|br)\/?>/g, function (m){ return m+'&nbsp;' });
html = html.replace(/<\/(p|div)>/g, function (m){ return m+'&nbsp;' });
html = html.replace(/<br\s*\/?>/g, function (m){ return m+'&nbsp;' });
html = html.replace(/\s+/g, ' ');
var e = document.createElement('div');
e.innerHTML = html;