On Fri, Feb 20, 2004 at 10:35:11AM +1100, Justin French wrote:
> 1. Parse the text on demand into HTML -- the parsing script is to 
> heavy/slow for this.
> 
> 2. Store both the plain (shorthand HTML) text and parsed XHTML versions 
> of each field -- the problem with this being that i'm storing double 
> the data in the database... combine this with versioning of each 
> 'page', and I'm going to be storing a LOT of data in the DB.
<snip>
> 3. write a reverse set of functions which converts the XHTML back to 
> the shorthand on demand for editing -- this seems great, but I don't 
> like the idea of maintaining two functions for such a beast.
> 
> 
> Has anyone got any further ideas?

4. Store the plain (shorthand HTML) text and when users 'save' changes,
generate a static page containing the transformed XHTML version.  You
will have the processing overhead once (when data is changed), and
everytime else visitors get static files.

It sounds like #3 would be quite difficult.  Going from HTML->XHTML you
know what the end result would look like.  Going the other way, you
won't know for sure what the users originally entered when they authored
the content.  I'm assuming this isn't a 1-to-1 transformation, so that
these:

  <b>Some bold text</b>
  <B>Some bold text</B>
  <b>Some bold text</B>

will all get turned into:

  <strong>Some bold text</strong>

If you turn the <strong> text back into <b>, then it's not clear which
of the three options you should use.

Unless I'm misunderstanding...

joel

-- 
[ joel boonstra | gospelcom.net ]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to