RE: [PEAR-DEV] HTML_BBCodeParser Wish List
| From: | Richard York | Date: | Wed, 10 Mar 2004 23:55:25 +0000 |
| Subject: | RE: [PEAR-DEV] HTML_BBCodeParser Wish List | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-26277@lists.php.net to get a copy of this message | ||
After pondering on this a bit more I had a few more ideas...
It would seem that in the interest of preserving resources
that it would also be nice if the class could convert back
to BBCode from HTML also. In its current state one cannot
store the text rendered as HTML, and also have the ability
for the user to edit the original BBCode'd text. Which
causes the programmer to have to call on the parser every
time the text is displayed. With a BBCode to HTML and
HTML to BBCode parser, the text could be stored rendered,
and then unrendered should the need to edit arise,
eliminating the parser from the viewer portion of the
application. (Which would also eliminate my need for a
BBCode strip_tags function, since the text would already
be rendered). Still might be a good idea to have one
though.
The HTML parser bit could be beneficial to other packages as
well (as Helgi mentioned).
Obviously I could also convert from BBCode to HTML and
then strip tags (which is probably what I'll do for a hot
fix), but that seems the long way around!
I can see that alot of the groundwork is already in place
for the former, an HTML to BBCode parser.. since the
opening and closing tag delimiters are customizable. But
doesn't appear to be reversible for all the HTML.
I also noticed that you use width= and height= in the img
tag, again a CSS option would be nice!
The HTML 4.01 validator also requires an alt attribute
with every img tag? Perhaps you could throw an empty one in
there, or allow for its specification with BBCode, such as
[img='path/to/image']Caption/Alt text[/img].
Regards,
Richard York