corzblog bbcode parser preview



Here it is! My [search engine fodder] bbcode to html parser, and html to bbcode parser [/search engine fodder]!

This is the actual very onsite parser that parses the bbcode of my blogs and site comments, which as well its usual tasks of, well, you know, the parsing stuff, also moonlights doing a cute wee background demo of itself, you're looking at it. it knew you wanted to do that. hit the "preview" button to see at least one half of the parser's bbcode to html/html to bbcode functionality.

The front-end (below) is built-in to the parser, you just call the function and it creates the form. The cool, super-portable JavaScript bbcode buttons and functions come in the package, too. Have fun. Oh, and by the way, output is 100% pure HTML5, or nice plain bbcode, which ever way you look at it, it's free.

button to undo the last javascript change
cbparser quick bbcode guide..
Most common bbtags are supported, and with cbparser's InfiniTags™ you can pretty much just make up tags as you go along. If cbparser can construct valid html tags out of them, it will. Experimentation is the key, and preview often.

A few bbcode examples..
[b]bold[/b], [i]italic[/i], [big]big[/big], [sm]small[/sm], [img]http://foo.com/image.png[/img], [code]code[/code],[code]teletype[/code], [url="http://foo.com" title="foo!"]foo U![/url], and more.. To post code with indentation and/or strange characters, .htaccess, etc., use [pre][/pre] tags.
download cbparser
an HTML5 compliant bbcode parser



Welcome to the comments facility!


previous comments (fourteen pages)   show all comments

cor - 06.03.06 5:49 am

Not a bad wee read, duck monster, but seriously, anyone who says "php is a joke" should provide salt with their text! smiley for :lol: Sure, php lacks some of the finesse of certain other languages, but zillions of sites really aren't wrong; it's is an incredibly useful language for web development.

Anyway, cbparser does, in fact, deal with unclosed and orphaned tags. Later versions will correct certain tag imbalance errors, insert missing tags, give appropriate warnings, and it always stopped the user if the tags didn't balance. In practice, this proves to be a fine way to deal with orphaned [ characters and anything else, encouraging users to understand and get their code right in the first place! That's not such a bad thing.

There are thousands of comments here onsite, so I know that even the most technically inept can comprehend and operate the bbcode facilities without trouble, and produce great looking, valid xhtml. That's good enough for me, and most other humans.

I have no aspirations to write "the perfect bbcode parser", even if I could, though I have considered ways to implement a php stream-state parser (as I see it), but none very fruitfully, I'm in no hurry, I'm having quite enough fun with the one I've got.

Truth is, there's nothing out there quite like cbparser. Do you know of another bbcode parser that will, for instance, mash you email addresses so spam-bots don't chew on them? Or provide built-in GUI, or spam-protection? Or convert arbirtary legacy html code? It's a wee bit more than a simple bbcode->html converter.

At the end of the day, I'm wrote this for me. True, thousands of others have grabbed it, but essentially it's part of corzblog, and will always be evolving to my own particular requirements. On request, I made it available for free, and maintain it in this modular state, no small amount of work, but that doesn't mean I'm looking to collaborate on it, in any shape or form!

Thanks for the input, though.

;o)
(or

ps.. it does prove one thing, however; a bbcode parser is important. smiley for :ken:


Billi - 14.03.06 7:17 pm

smiley for :lol:smiley for :lol:smiley for :lol:


Roy - 14.03.06 11:19 pm

Hi cor, thanks for this, great work!

I noticed in the newest betas that there is provision for a spell checker, and that also runs here on your comments, is there any way to enable this, I can't find it anywhere. thanks.

by the way, the new buttons are very cool! smiley for :cool:

Roy



cor - 16.03.06 3:13 pm

Cheers Roy! Very observant!

The spell-checker is something I'm putting together for corzblog, though I've no plans to release as a separate entity, if you really want to play with it, feel free to drop me a mail; I could send you something.

;o)
(or


jds - 16.04.06 7:08 pm

I wanted bbcode for our commments, five minutes later we have bbcode!

Thank you!


mark - 21.04.06 8:53 am


<advert snipped -ed>


Red - 01.05.06 1:35 pm

Just wanted to say thanks for a great parser smiley for :D Saved me loads of time from making it myself ::love:::

Now I just need to go through it and figure out where to add my own smilies smiley for ;)


ss - 03.06.06 2:56 pm

test


Michael B. Parker - 05.06.06 3:50 am

THANKS FOR THE EFFORT! :-) Yours is 1st on Google as far as "HTML to BBCode" search.

However, THE html2bb DOESN'T SEEM TO WORK. For example, doing
Standard <b>bold</b>, <i>italics</i>.

produces
Standard[b>bold</b>,[i>italics</i>.


Has the html2bb also been debugged? How to fix?
And any alternative html2bb programs or web-apps you can recommend? The 2nd google listing, http://javascript.about.com/library/blscr01.htm, doesn't reliably either.

BTW, html2bb seems far more valuable since there are ton of WYSIWYG HTML editors out there, yet few BB editors, people (myself included) wanting to compose in a WYSIWYG, would then frequently need to subsequently go "HTML to BBCode". If you would be great (even more useful) if you put html2bb on the web - might increase your traffic dramatically.

-Mike Parker, www.Cytex.com


cor - 05.06.06 7:10 am

Thanks for the keywords Michael!

The html>>bb doesn't need debugged, it works great! I use it every day. If you post a comment here, include some tags, and then edit your comment, you will see. Perhaps you have an old version or something. Always grab the latest beta, as used right here.

The only known issue with the current version is back-slashes inside pre tags, you need to double them. (it's actually been fixed in my dev mirror version, but hasn't been packaged up yet)

And my traffic has been increasing quite enough! I've had to upgrade my hosting package twice this year already. smiley for :eek:

Grab the latest beta. I'll try and get around to packaging up my dev version this week, and swapping it in so there's only one download.

l*rz..

;o)
(or


sebgymn - 06.06.06 6:31 pm

one little question:
how can i use the htmltobb parser? entering html code to the textarea, and hitting "preview", but it gives html! one plz help. tried thousand times but it only gave in html form. and i also tried in my local apache server but i cant create the post file. im a noob in php, forgive.


next comments (6 pages)

First, confirm that you are human by entering the code you see..

(if you find the code difficult to decipher, click it for a new one!)


gd verification image

 

Welcome to corz.org!

I'm always messing around with the back-end.. See a bug? Wait a minute and try again. Still see a bug? Mail Me!