A new paragraph in a textarea field within a structure field breaks the content

Hi!

I have a problem when typing content with a paragraph in a textarea (from a custom block) in a structure field.
When the content is saved, it disappears.
I discovered that in the content file (.txt), creating a new paragraph (pressing Enter key) is rendered as “\n” and this seems to break the content and the reason why it is not saved.

Switching the textarea field to a writer field seems to solve the problem by applying a <p></p> instead of ‘\n’.

Perhaps this is a problem with Kirby’s core code. What do you think?

Just to confirm: you have a custom block with a structure field, and inside this structure field you use a textarea field?

Which Kirby version?

It’s the other way around. I also forgot to mention the layout.
A structure > Layout > Custom bloc > Textarea field.

With Kirby 3.7.5

I can reproduce this issue with a layout field inside a structure, works with a blocks field.

That is kind of a good news :slight_smile:
Thank you!
Should I mention that somewhere else so the team can have a look later and try to fix the bug?

In the meantime I will use a writer block instead of textarea.

If you could create an issue on GitHub, that would be great. Couldn’t find an existing issue, but might have missed it.

hej, @nicopizza and @texnixe — I can also confirm and reproduce this behaviour, placing any (custom)-block containing a textarea into a layout that lives in a structure. :boom:
(I am using Kirby 3.9.7 with php 8.2)

Is there any workaround except using a writer field (which instead of placing \n is writing HTML)
Has anyone created an issue on gitHub yet?

Best
Marc