mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-14 12:18:30 +03:00
Return 0 if no html
This commit is contained in:
parent
db25770a31
commit
509c1d971e
1 changed files with 1 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
const div = document.createElement('div');
|
||||
export default function htmlContentLength(html) {
|
||||
if (!html) return 0;
|
||||
div.innerHTML = html;
|
||||
return div.innerText.length;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue