Last active
July 14, 2016 09:26
-
-
Save electerious/27bfd5aa51567a33e69d91a90c773b42 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
const decodeHTML = (str) => { | |
const elem = document.createElement('div') | |
elem.innerHTML = str | |
return (elem.childNodes.length===0 ? '' : elem.childNodes[0].nodeValue) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment