1
0
Fork 0
mirror of https://github.com/cheeaun/phanpy.git synced 2025-03-28 08:31:35 +01:00
phanpy/src/utils/html-content-length.js

7 lines
173 B
JavaScript
Raw Normal View History

const div = document.createElement('div');
2022-12-16 13:27:04 +08:00
export default function htmlContentLength(html) {
2022-12-19 17:30:10 +08:00
if (!html) return 0;
div.innerHTML = html;
return div.innerText.length;
2022-12-16 13:27:04 +08:00
}