Re: can BBCode_Parser validate?

From: Date: Wed, 26 Oct 2005 13:15:19 +0000
Subject: Re: can BBCode_Parser validate?
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21642@lists.php.net to get a copy of this message
Download the linked package. The code that handles that is in the HTML_BBCodeParser class. When you create an object, you can pass in an array of options. The 'onError' and 'onWarning' options control how the parser handles problems during parsing. Usage Examples: - If you only accept valid input, set both warn and error to 'abort' and parsing will be aborted as soon as a problem is found. - If you accept invalid feedback, but want to give the user feedback which tags caused problems, then set both error and warn to 'ignore' and the bad tags will be displayed. - If you want to make the output as pretty as possible, then you want to auto correct when you can and delete when you can't. Set the options to 'delete' on error, and 'correct' on warn. ~Seth On Oct 26, 2005, at 2:54 AM, Guy Brom wrote:
Dear Seth, Where should I look for that specific piece of code? Thanks "Seth Price" <seth@pricepages.org> wrote in message news:068A6E23-5D43-4754-A6E6-AB5774552BAC@pricepages.org...
Ah, sorry I didn't notice your email on the list earlier. I have a so- far-unofficial version of BBCodeParser written that allows you to specify whether to abort, ignore, or correct on BBCode errors. It also guarantees XHTML 1.1 output. Tell me what you think of the code: http://pricepages.org/bbcode/BBCodeParser.zip ~Seth On Oct 13, 2005, at 10:05 AM, Guy Brom wrote:
Is it possible to automatically fix broken BBCode using BBCode_Parser? I'm trying to validate an incoming bbcode field (i.e. - "hello [b] world[/u]" =to_become=> "hello [b]world[/b]"). Thanks! --PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.pear.general (#21642) next »