Created
March 6, 2020 08:48
-
-
Save andreasvirkus/a7a4b4434b2c2914601fe116832c5bdf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const strip = html => { | |
const doc = new DOMParser().parseFromString(html, 'text/html') | |
return (doc.body.textContent || '').trim() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment