# \[Announce\] node-red-contrib-html-entities

**URL:** <https://discourse.nodered.org/t/announce-node-red-contrib-html-entities/16664>\
**Category:** Share Your Nodes\
**Created:** [13 October 2019 19:22 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-html-entities/16664 "2019-10-13T19:22:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [13 October 2019 19:22 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-html-entities/16664/1 "2019-10-13T19:22:00Z")

</div>

Hi all,  
After several days of messing around in a flow and a growing number of function nodes filled with regex replacements of HTML entities by the character they represented I decided it was time to replace it by a node instead. I had previously searched around, but didn't manage to find anything, but there were suitable libraries on NPM available. So I created a wrapper node around the [`he` html entities package](https://www.npmjs.com/package/he).

Today after several iterations of code it reached the stage where it became ready for public usage. So here I present `node-red-contrib-html-entities`:

> **[node-red-contrib-html-entities](https://flows.nodered.org/node/node-red-contrib-html-entities)**
>
> Tiny node-red wrapper node around the html entities library called 'he'.

 ![44](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a7f9799311cacb3bfdeca01d71688b2e235b3fdd.png) ![26](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/76d89458b79067ef5d36d29de53b79ebb58800fd.png)

One of the practical use cases that I'm working with is parsing (partial) HTML files, then sending forward fragments from that snippet. As these are all 3rd party controlled systems, I have no control over how the text that's coming in looks like. Even better, the most used website where I ran into this issue has a really wide character range that they allow users to use/post with. Em-dashes and curly quotes were the first characters that ended up in those replacement functions, but accented letters were encoded as well.

Constructive feedback is always welcome 🙂

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [13 October 2019 22:40 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-html-entities/16664/2 "2019-10-13T22:40:27Z")

</div>

Hi, looks useful,. Couple of comments, generally we have the name as the last field as its usually optional. And I would have the mode first so it "reads" like a sentence.. Eg. Encode the msg.payload ...

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [14 October 2019 06:09 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-html-entities/16664/3 "2019-10-14T06:09:33Z")

</div>

Perfect, thanks again Dave. It’s still looking better than I had initially expected. CSS and layouting in general isn’t my strongest suit. Even went as far as put core nodes code on a second screen (my previous job learned me to utilise a single screen when in reality you need 2 or 3, so I hardly use a second screen nowadays).  
But after a while you’re so deep in the code you forget the usability or best practices. Your feedback has been very useful 🙂
