this repo has no description
1const div = document.createElement('div');
2export default function htmlContentLength(html) {
3 if (!html) return 0;
4 div.innerHTML = html;
5 // .invisible spans for links
6 // e.g. <span class="invisible">https://</span>mastodon.social
7 div.querySelectorAll('.invisible').forEach((el) => {
8 el.remove();
9 });
10 return div.innerText.length;
11}