Issue with jinja2 templating on python code node

Hi,

When using jinja2 templating with a python code node, the rendered template get 2 trailing whitespaces before each new line. I tried to reproduce unsuccessfully the issue locally on my linux computer. So I guess there is something to do with the javascript python interpreter in the middle?

How to reproduce

You can copy paste the same code locally to execute it in an original python interpreter. The result won’t be the same.

Why this is an issue?

I’m using it for making markdown files. Markdown is sensible to trailing whitespace for multiple items like lists and tables. With these trailing whitespaces, the markdown rendering is not correct.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @Nicolas_Michel

Thanks for bringing this up! We will include this in our improvements to be made to our Code Node! :pray:

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