PricingDocsAcademy
Bluesky ...
Wed, Dec 11, 10:57 PM

Parse JSON newline character in textarea

  • Tom Ireland

    1 month ago

    Hey, folks! Does anyone know how to parse/decode a newline character (\n) in a textarea's value attribute?

    When saving JSON to Supabase, if the textarea has been input with breaking spaces, it stores the content correctly with \n when sent via an API request, however when you load the content back in the text area, the breaking spaces are replaced with the newline character \n.
  • Erik Beuschau

    1 month ago

    Try creating a variable that holds \n and use the variable when you parse the output
  • Tom Ireland

    1 month ago

    I'm not quite sure I understand, Erik. Can you expand on that, please? It's probably really simple. 🫣
  • Erik Beuschau

    1 month ago

    @Jacob Kofoed do you remember if we have an example of this somewhere? πŸ€”
    πŸ™1
  • Jacob Kofoed

    1 month ago

    I don’t think I’ve done it before, but let me look quickly πŸ‘€
    πŸ™1
  • Max

    1 month ago

    πŸ™Œ1
  • Erik Beuschau

    1 month ago

    Thank you @Max πŸ™Œ I knew this had been brought up somewhere before πŸ˜…
    πŸ’ͺ1
  • Tom Ireland

    1 month ago

    Thanks, Max - you're a legend. I'll test that out. Appreciate the input, gents (pun intended). πŸ˜„
    πŸ’ͺ1

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code β€” but accessible to your entire team!

Try toddle β€” it's free!

Β© Copyright 2024 toddle. All rights reserved.