Welcome Guest, Not a member yet? Register   Sign In
auto_typography vs. WYSIWYG (BBcode, Textile, Markdown, HTML)

First of all, I searched before in this forum and didn't find what I was looking for.

I'm curious about how do you prefer to store the data in the database, for example a blog post and what is the best practice, what consume less resources, what is faster or dis/advantages between every method.

I've been using basic HTML inside my DB (for example code just with strong, em, img, a... but without the <p>). After this, i use auto_typography for the <p>.

Wordpress uses a similar method but I think it consumes more resources (also the CI Guide stands "Typographic formatting can be processor intensive, particularly if you have a lot of content being formatted.") than storing it in valid HTML or using textile/markdown/bbcode and just decode it.

What do you think about all of this?

[eluser]Craig A Rodway[/eluser]
The section where you want the best performance is on the front-end, and the best way to do this is to pull out just the raw HTML code, so that no extra processing has to be done at this stage.

In the back-end, you need between one and three tables to store formatted content. One table for the raw HTML code (including all &lt;tags&gt; etc) - this goes without saying. If you have some form of search or RSS, the chances are you will also need a plain-text version of the content without the HTML tags. This can be achieved using PHP's strip_tags() function.

Finally, if you use something like BBCode, Textile or Markdown, you'll need a table to store that data for the back-end editing pages.

This way, most (if not all) of the processing is done once at the editing/posting stage before going to the database.

Theme © iAndrew 2016 - Forum software by © MyBB