So "<h1>Hello World</h1>"
will just return 'Hello World'.
I've tried:
$('<div>').html('<h1>Hello World</h1>').text()
And that works fine in most cases, but it does open up an xss vulnerability for when the string is something like this: <img src=1 onerror=alert(/XSS/)>
, when I expect it to return an empty string