Parse JSON newline character in textarea

  • tomthebigtree-1305296444303085588

    Tom Ireland

    5 months 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.
  • erikbeus-1305443127322083328

    Erik Beuschau

    5 months ago

    Try creating a variable that holds \n and use the variable when you parse the output
  • tomthebigtree-1305463958270119976

    Tom Ireland

    5 months ago

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

    Erik Beuschau

    5 months ago

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

    Jacob Kofoed

    5 months ago

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

    Erik Beuschau

    5 months ago

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

    Tom Ireland

    5 months 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.