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
  • 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