Search code examples
htmlmeteorline-breaks

Meteor saving a line break inputed by the user within the input field


Is there a package with meteor that can allow me to save a line break within a string inputted by the user? If so, how can this be achieved?

Possibly creating a helper that generates the markdown on keypress which===13?


Solution

  • A new line in a textarea will be saved in the database by default (the \n character). After loading the saved text you could either wrap it in a <pre> tag which will preserve que \n or convert all \n to <br> with a helper