Issue returning html in form

Describe the problem/error/question

Before the recent updates that sanitize HTML in form nodes, I was using a custom HTML form field to return some data to the user from the workflow using a HTML table. This is now broken, even with HTML that doesn’t contain <script>, <style> or <input> tags

What is the error message (if any)? N/A

Share the output returned by the last node

This is what my Code node generates for the HTML:

[
  {
    "tableHTML": "\n    <h2>Sheets needed for Job 123456 - Test Job</h2>\n    <br>\n    <table>\n      <tr style=\"background-color: #f2f2f2;\">\n        <th>Code</th>\n        <th>Description</th>\n        <th>Quantity</th>\n        <th>Stock</th>\n      </tr>\n  \n      <tr>\n        <td>SM10AL3012</td>\n        <td>Sheet Metal 1.0mm Aluminium 3050 x 1200</td>\n        <td>2.4</td>\n        <td>50</td>\n      </tr>\n    \n      <tr>\n        <td>SM20GL3012</td>\n        <td>Sheet Metal 2.0mm Galv 3050 x 1200</td>\n        <td>0.1</td>\n        <td>-24.8</td>\n      </tr>\n    </table>"
  }
]

Information on your n8n setup

  • n8n version: 1.81.4
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: Ubuntu Server 22.04

hello @revilo951

you can render html in the Next Form Page node

I’m trying that, however it’s not rendering the html table I’m giving it. It used to, before the last couple updates. Here’s a sample of HTML I’m trying to render:

<table>\n\n  <tr>\n    <td>SM10AL3012</td>\n    <td>Sheet Metal 1.0mm Aluminium 3050 x 1200</td>\n    <td>2.4</td>\n    <td>20.92</td>\n  </tr>\n\n  <tr>\n    <td>SM20GL3012</td>\n    <td>Sheet Metal 2.0mm Galv 3050 x 1200</td>\n    <td>0.1</td>\n    <td>44.6</td>\n  </tr>\n\n</table>

It doesn’t render a table at all, just puts all the text onto one line.

Seems table property isn’t supported…

However, list is working.

List:
<ul><b>Entry One</b>
  <li>SM10AL3012</li>
  <li>Sheet Metal 1.0mm Aluminium 3050 x 1200</li>
  <li>2.4</li>
  <li>20.92</li>
</ul><br><br>

<ol><b>Entry Two</b>
  <li>SM20GL3012</li>
  <li>Sheet Metal 2.0mm Galv 3050 x 1200</li>
  <li>0.1</li>
  <li>44.6</li>
</ol><br><br>

Yes, it’s a shame. I’ve had to push the data to an external system to display it to the user. Hopefully they can fix it soon!

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