Rendering newline character in VueJS

前端 未结 6 1225
离开以前
离开以前 2020-12-24 00:06

I\'m creating a note app where users can add a note by entering multiline text in a textarea. When I save the note in Firebase it is being saved with newline (\\n) character

6条回答
  •  离开以前
    2020-12-24 00:58

    Use white-space: pre-line; CSS property.

    As write in Mozzila Doc for pre-line value:

    Sequences of white space are collapsed. Lines are broken at newline characters, at
    , and as necessary to fill line boxes.

提交回复
热议问题