B
B
Boogie19892016-07-07 22:40:04
MongoDB
Boogie1989, 2016-07-07 22:40:04

How to store messages?

The essence of the matter is this. There is a certain site on which there will be a forum written on Angular+Express. The question is how to correctly save messages so that they are saved with the markup entered by the user. That is, with all the tabs, paragraphs and other things? I heard that storing HTML markup in the database is not the best option, what to do? Can I create my own html file for each message, and only the path to the file in the database?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
littleguga, 2016-07-07
@littleguga

Use MarkDown markup.
There are a lot of parsers, converters and whatever else you want for js.

N
napa3um, 2016-07-08
@napa3um

The question is how to save messages correctly so that they are saved with the markup entered by the user

in HTML.
If you limit the user to <p>, <h>, <b>, <i>and cut off all JS, then everything will be fine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question