Return of the HTML_BBCodeParser

From: Date: Thu, 19 Jan 2006 17:51:19 +0000
Subject: Return of the HTML_BBCodeParser
Groups: php.pear.dev php.pear.general 
Request: Send a blank email to pear-dev+get-40992@lists.php.net to get a copy of this message
Some of you may remember my HTML_BBCodeParser package. Well, I've made a few improvements and I thought I'd alert y'all. (This post was written with the new ASCII renderer.) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
             http://pricepages.org/bbcode/BBCodeParser.zip
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# Summary of total progress (since v1.1): 1.Most bugs have been fixed. The remaining bugs are of questionable
    validity.
2.Regardless of BBCode input, the output should be always valid XHTML
    1.1.
3.You are given options for how to handle invalid BBCode input.
    Examples:
      a.You can now abort and tell the user the line and char number
        where invalid code was detected.
      b.You can correct bad BBCode where you can, and delete it where
        you can't.
      c.You can simply display all invalid tags as text.
4.Much faster. 5.ASCII rendering added. Give it a column width, and it will nicely
    render and wrap text to fit.
6.More complete tag support (tags/attributes added, some extra
    backwards compatibility added)
      a.Tags: 'hr', 'p', 'br', 'h1', ..., 'h6', 'attr'
      b.Attributes: 'title' in <a>, 'alt' in <img/>
      c.Backwards Compat: Easier to re-enable 'start' in <ol>, but if
        you do it breaks XHTML 1.1
7.Parsing example script updated with new tags and is now XHTML 1.1. 8.Very thorough unit tests. 9.Filters can be added and removed without re-creating the object. Summary of progress since last posting: I.More unit tests II.ASCII rendering III.Added tags 'hr', 'p', 'br' IV.Added option to not escape HTML tags V.Better correction of bad BBCode VI.Harmless notices removed VII.More bugs fixed VIII.Example script updated Backwards Compatibility Breaks: * Different PHP format for filters * 'start' attribute removed from <ol> tag (it isn't in XHTML 1.1) * HTML is automatically escaped (optionally) Previous useful posts on the subject: * Previous release announcement:
    http://beeblex.com/lists/index.php/php.pear.dev/40221
* BC Break description:
    http://beeblex.com/lists/index.php/php.pear.dev/40227
* Invalid BBCode handling description:
    http://beeblex.com/lists/index.php/php.pear.general/21642
So, what do you think? ~Seth

« previous php.pear.dev (#40992) next »