Download wp-calypso/client/lib/formatting/decode/browser.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 409 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/formatting/decode/browser.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/lib/formatting/decode/browser.js
-
curl -L -o browser.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/formatting/decode/browser.js
409 Bytes
| const element = ( () => { | |
| if ( document.implementation && document.implementation.createHTMLDocument ) { | |
| return document.implementation.createHTMLDocument( '' ).createElement( 'textarea' ); | |
| } | |
| return document.createElement( 'textarea' ); | |
| } )(); | |
| export default function decodeEntities( text ) { | |
| element.innerHTML = text; | |
| const decoded = element.textContent; | |
| element.innerHTML = ''; | |
| return decoded; | |
| } | |