Skip to content

Instantly share code, notes, and snippets.

@nkint
Created April 27, 2018 10:27
Show Gist options
  • Save nkint/7754d2e8e8de6c3bb0f5af34c74910b8 to your computer and use it in GitHub Desktop.
Save nkint/7754d2e8e8de6c3bb0f5af34c74910b8 to your computer and use it in GitHub Desktop.
Escape character "
export function htmlDecode(input) {
var doc = new window.DOMParser().parseFromString(input, 'text/html')
return unescape(doc.documentElement.textContent)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment