Test case details

Preparation Code

const title = '<div><p><strong>text</strong>more text</p></div>' const parser = new DOMParser();

Test cases

Test #1

title.replace(/<[^>]*>/g, '').trim().length

Test #2

parser.parseFromString(title, "text/html").body.textContent.trim().length