yizhi-html-escape

HTML escape character util

Usage no npm install needed!

<script type="module">
  import yizhiHtmlEscape from 'https://cdn.skypack.dev/yizhi-html-escape';
</script>

README

yizhi-html-escape

A HTML escape character util. (>_<)

Usage

import {escape, unescape} from 'yizhi-html-escape'

escape('<div>Tom&Jerry</div>')
//Output:
// &lt;div&gt;Tom&amp;Jerry&lt;/div&gt;


unescape('&pi;=3.14, &yen;&cent;&pound;&copy;&reg;')
//Output:
// π=3.14, ¥¢£©®