Tired of waiting for BetterBBCode to get better? Then give
the new BBCodeParser a go. It works well with the BBInsertBar and has great formatting flexibility supporting even more BBCode. It will happily sit along side other text formatters as well.
*** Nested Lists!
*** Hacked in support for YouTube video via the [youtube][/youtube] tag
*** Easy to update to newer versions of the PEAR HTML_BBCodeParser
*** Requires PEAR in your PHP installation
To do:
+ Create Video.php filter to include other video sites such as Google, MSN SoapBox, Metacafe et al and move the ugly hack for YouTube to there to make it nice and smart.
+ Add options screen to make the tags configurable, ie. arbitarily disable any BBCode tags you dislike. Initially, this could work broadly by disabling whole filters.
This extension uses Seth Price's version of the PHP PEAR HTML_BBCodeParser which
fixes many of the official bugs listed on the official site.
Comments
How blank? Just where the content area, or even the header and navs?
Also, which other extensions do you have installed and activated?
Circuit, if you give us some more information we might be able to track the problem down.
Can I include it in my Vanilla dir? (I can't install php packages on the server)
SirNot, you're too clever for me :P
Here's some random code
<code>and this lot's in a nested code
The above is actually this:
There's a basic problem with this. How do the machine know to not close the first one? It doesn't know there will be a second one. That's why the HTML version screws up as well. For the BBCode version, I reckon something like a new [bbcode][/bbcode] tag would solve this problem. What this tag would need to do is prevent the parser from parsing any more BBCode until the [/bbcode] tag comes in. Of course, that means you can't have nested [bbcode] tags, but... are there other solutions to this that I can't see?
...and the html formatter screws up your code example because a) it dosn't allow code tags to be nested (although in this case they did manage to come out like that as a consequence of the 'tag police') and b) it automatically converts all html within code tags to their entity equivelents.
Regarding your a) comment, what's this about the "tag police" (I feel like I've missed part of a discussion here somewhere) and how are they causing the strangeness with Html Formatter?
As to b), how does converting to entity equivalents make that example display like that?
I really appreciate your input on this as you obviously have a far greater understanding of these things than I do. So if you would be so kind as to continue, I would really appreciate it :)
SirNot, thanks again. Just attempting to wrap my head around it all!
I'd rather keep it (the html formatter) simple and not try to second guess the poster.
In the case of BBCode, I suppose you can always do it in the HTML formatter and vice-versa...
// set the default formatter to BBCode$Context->Configuration['DEFAULT_FORMAT_TYPE'] = 'BBCode';
above/before line 13:
class AutoPFormatter extends StringFormatter {Regarding the line break stripping, that is just a function of this version of the parser. BBCodeParser strips everything out and pretty much all the other formatters whack extra ones in all over the place, so that's why AutoP exists. Install and enable AutoP and see if that makes things better for you.
Regarding the whole default formatter thing, do people think it would be rude to have the formatter default itself by default? What happens when you have two formatters that do the same thing?
Let me know, thanks :)
Solving the nested quote problem would be enough for me, and perhabs for many others too?
Posting code is a more sophistcated problem, because of all the nice things we like to have for code: line numbers, syntax hightligthning, nice breaks... perhabs this should be handled by a diffrent extension?
Bye
Tiggr