html5entitieses6
v1.0.1
Published
Code is same as https://www.npmjs.com/package/html-entities but uses the ES6 import method rather than module.exports. Note: I only used html5-entities.
Readme
Usage
Can be used in modern browsers that use ES6 import.
<body>
<h1 id="h1"></h1>
<script type="module">
import { Html5Entities } from "https://www.unpkg.com/html5entitieses6";
const entities = new Html5Entities();
const msg = entities.decode("'hello world'");
h1.textContent = msg;
console.log(msg);
</script>
</body>Credits:
Code is from https://www.npmjs.com/package/html-entities but instead of using module.exports to export the function, I changed it to export function Html5Entities () {}.
