mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 22:26:57 +01:00
Truncate URLs
This commit is contained in:
parent
d71b1a7e36
commit
ffabd6188d
1 changed files with 11 additions and 0 deletions
|
@ -9,6 +9,17 @@ function getHTMLText(html) {
|
||||||
div.querySelectorAll('br').forEach((br) => {
|
div.querySelectorAll('br').forEach((br) => {
|
||||||
br.replaceWith('\n');
|
br.replaceWith('\n');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// MASTODON-SPECIFIC classes
|
||||||
|
// Remove .invisible
|
||||||
|
div.querySelectorAll('.invisible').forEach((el) => {
|
||||||
|
el.remove();
|
||||||
|
});
|
||||||
|
// Add … at end of .ellipsis
|
||||||
|
div.querySelectorAll('.ellipsis').forEach((el) => {
|
||||||
|
el.append('...');
|
||||||
|
});
|
||||||
|
|
||||||
return div.innerText.replace(/[\r\n]{3,}/g, '\n\n').trim();
|
return div.innerText.replace(/[\r\n]{3,}/g, '\n\n').trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue