# Html node not working on string

**URL:** https://discourse.nodered.org/t/html-node-not-working-on-string/101705
**Category:** General
**Created:** [31 August 2026 05:41 UTC](https://discourse.nodered.org/t/html-node-not-working-on-string/101705 "2026-08-31T05:41:03Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [31 August 2026 05:41 UTC](https://discourse.nodered.org/t/html-node-not-working-on-string/101705/1 "2026-08-31T05:41:03Z")

</div>

Does the html node require more than just a string in `msg.payload` or does the template node encode the content ? (ie. it looks like html but actually uses an encoded string?)

inject node \> template node (as plain text) \> html node, selector: `td`

Template node content:

```auto
<td>some content</td>
<td>blabla<br/><a href="#" rel="nofollow"
        title="some title">blabla</a>
</td>

```

No results.

example flow:

```auto
[{"id":"3f0c5e0f41be1217","type":"inject","z":"dd601c6b09710814","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":320,"y":920,"wires":[["4719a15d81f40618"]]},{"id":"4719a15d81f40618","type":"template","z":"dd601c6b09710814","name":"","field":"payload","fieldType":"msg","format":"html","syntax":"plain","template":"<td>some content</td>\n<td>blabla<br/><a href=\"#\" rel=\"nofollow\"\n title=\"some title\">blabla</a>\n</td>\n","output":"str","x":480,"y":920,"wires":[["3b51dad0260b58d7"]]},{"id":"3b51dad0260b58d7","type":"html","z":"dd601c6b09710814","name":"","property":"payload","outproperty":"payload","tag":"td","ret":"text","as":"single","chr":"_","x":610,"y":920,"wires":[["e5af80508a63d73d"]]},{"id":"e5af80508a63d73d","type":"debug","z":"dd601c6b09710814","name":"debug 44","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":740,"y":920,"wires":[]}]

```

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [31 August 2026 06:58 UTC](https://discourse.nodered.org/t/html-node-not-working-on-string/101705/2 "2026-08-31T06:58:27Z")

</div>

Try wrapping your content in a div

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [31 August 2026 08:03 UTC](https://discourse.nodered.org/t/html-node-not-working-on-string/101705/3 "2026-08-31T08:03:59Z")

</div>

is that a workaround or a bug ? No difference btw.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [31 August 2026 08:57 UTC](https://discourse.nodered.org/t/html-node-not-working-on-string/101705/4 "2026-08-31T08:57:31Z")

</div>

try wrapping in a `<table></table>` tag.

There was a change to library some time ago (like maybe 2 years ago) that affected html fragments are handled.

Ah, here is a follow up issue: [feature: HTML: add option to handle fragments rather than whole docs · Issue #3423 · node-red/node-red · GitHub](https://github.com/node-red/node-red/issues/3423)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [31 August 2026 08:59 UTC](https://discourse.nodered.org/t/html-node-not-working-on-string/101705/5 "2026-08-31T08:59:25Z")

</div>

oh, and there is more here: [HTML node not extracting content · Issue #3137 · node-red/node-red · GitHub](https://github.com/node-red/node-red/issues/3137) (you might recognise one of the conversation participants 😉

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [31 August 2026 10:30 UTC](https://discourse.nodered.org/t/html-node-not-working-on-string/101705/6 "2026-08-31T10:30:37Z")

</div>

lol its been a while - guess it requires the complete html, table and tr included, then it indeed works. Have to see how i can append it within a flow with elements.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [14 September 2026 10:31 UTC](https://discourse.nodered.org/t/html-node-not-working-on-string/101705/7 "2026-09-14T10:31:28Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
