Hi Brian,

Some belated response: Could you show us your code?

With the following RESTXQ code, all newlines should be preserved:

declare
  %rest:path('in')
  %output:method('html')
function local:get() {
  <form action='out' method='post'>
    <textarea name='text'>A{ char('\n') }B</textarea>
    <input type='submit'/>
  </form>
};

declare
  %rest:POST
  %rest:path('out')
  %rest:form-param('text', '{$text}')
  %output:method('html')
function local:out($text) {
  <html>Codepoints: { string-to-codepoints($text) }</html>
};

Best,
Christian


On Fri, Feb 7, 2025 at 6:51 PM <brian@kennison.name> wrote:
Everyone,

I’m trying to build a comment form using RESTXQ that has a texarea element. I was hoping to use the new lines from the textarea for simple formatting but when the form is submitted the request parameter is striped of all the linefeeds ( it looks like normalized text). Is this the expected behavior?

Thanks — Brian