On Stackoverflow I've found questions about storing BBCode OR HTML into the database, but what about storing both? For example, I would create posts
DB table with two columns: body_bbcode
& body_html
.
In body_bbcode
I would store original post submitted by a user (forum member), and in body_html
I would store parsed (HTML) version of that post.
So, for displaying forum posts I would use body_html
, but for editing & quoting (replying with quote) I would use body_bbcode
.
The reason why I want to do this is because the parser is using regex and without body_html
it would need to convert at least 15 forum posts per topic page. Correct me if I'm wrong, but that can cause performance issues?
On the other hand, I didn't see anyone doing like this so I'm wondering what are the disadvantages of this approach, besides taking up more space in the Database?
Also, I am thinking of adding a new column in which I would store plain text version for search purposes, so that the tags themselves aren't searched (for example body_text
).