English 中文(简体)
在数据库储存之前或之后的格式案文投入?
原标题:Format text input before or after storing it in the database?

首先,我不使用WYSIWYG。 唯一的形式如下:*italic*,**bold**,#header#,[link](www.link.com),并可能是其他的。

^ That being the case, when do I do the actual parsing? Before I store it in the database OR after I retrieve it from the database?

I would rather not do it before storage, but I m unsure...

最佳回答

After you ve retrieved the text from the database. Parsing it before storing it means that you lose your "styling tags" and you or your users will be presented with the plain HTML code if you re retrieving it again for editing.

问题回答

我建议,这取决于你重新布局的内容量以及你们的交通量,因为对大街的封锁行动会给资源带来巨大饥饿。 并且,你在试图显示你内容的每一个页上都有可能这样做(除非你使用某种ach子)。

如果你能够将标记压缩为超文本,那么,如果需要的话,你可以将其重新贴上标记。 因此,为了在网站前线上显示速度,以超文本形式将其保留到数据库中,就意味着你不得不检索数据库,并把它放出。 为了编辑,你可以按需要将其重新贴上标记。





相关问题
Parse players currently in lobby

I m attempting to write a bash script to parse out the following log file and give me a list of CURRENT players in the room (so ignoring players that left, but including players that may have rejoined)...

How to get instance from string in C#?

Is it possible to get the property of a class from string and then set a value? Example: string s = "label1.text"; string value = "new value"; label1.text = value; <--and some code that makes ...

XML DOM parsing br tag

I need to parse a xml string to obtain the xml DOM, the problem I m facing is with the self closing html tag like <br /> giving me the error of Tag mismatch expected </br>. I m aware this ...

Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

Locating specific string and capturing data following it

I built a site a long time ago and now I want to place the data into a database without copying and pasting the 400+ pages that it has grown to so that I can make the site database driven. My site ...

热门标签