Skip to content

Instantly share code, notes, and snippets.

@andreasvirkus
Created March 2, 2022 07:12
Embed
What would you like to do?
export const strip = (html: string) => {
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