HTML Entities
HTML entity utilities for WordPress.
Installation
Install the module
npm install @wordpress/html-entities --save
This package assumes that your code will run in an ES2015+ environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using core-js will add polyfills for these methods.
API
# decodeEntities
Decodes the HTML entities from a given string.
Usage
const result = decodeEntities( 'á' );
console.log( result );
Parameters
- html
string
: String that contain HTML entities.
Returns
string
: The decoded string.