I had a little spare time to do some work on postmarkup.py, my BBCode module. It now handles Unicode correctly, which was a big omission, considering its intended use. I also added a few other features. The tag parameter string can now be specified in 3(!) different ways. For example, the following 3 lines are equivalent.

[link=http://www.willmcgugan.com]My homepage[/link]

[link="http://www.willmcgugan.com"]My homepage[/link]

[link http://www.willmcgugan.com]My homepage[/link]

Another addition, is an [img] tag.

[img]http://www.willmcgugan.com/wp-content/uploads/ant.png[/img]

There is also support for lists (ordered and un-ordered), with the phpbb syntax. For example:

[list]

[*]Apples

[*]Oranges

[*]Pears

[/list]

This produces an un-ordered list.

  • Apples
  • Oranges
  • Pears

I didn't implement the [size] and [color] tags, because for my purposes I don't want users creating annoying text! If you need them, take a look at the code - new tags are fairly easy to implement. For more information, please see the other posts regarding bbcode on my blog, or contact me.

Download postmarkup.py

I plan on putting postmarkup and some of my other open source code on google code when I have more spare time. Bare with me folks!

This blog post was posted to It's All Geek to Me on Thursday May 31st, 2007 at 10:12PM
 

1 Response to "BBCode Python Module III"

  • June 30th, 2007, 8:11 p.m.

    Good job, thanks for including my suggestions/fixes!

    I completely agree that the omission of [size] and [color] are good. I don't want them on my site either, and I would have disabled them if you had them in there.

Leave a Comment

You can use bbcode in the comment: e.g. [b]This is bold[/b], [url]http://www.willmcgugan.com[/url], [code python]import this[/code]
Preview Posting...
Previewing comment, please wait a moment...
Will McGugan

My name is Will McGugan. I am an unabashed geek, an author, a hacker and a Python expert – amongst other things!

You are reading my tech blog. See the homepage for my other blogs.

Search for Posts
Possibly related posts
Tags
 
Popular Tags
 
Archives
2010
 
Recent Comments
http://www.iclshoes.com/alexander-mcqueen-c-13.html [iclshoes.com] http://www.iclshoes.com/jimmy-choo-shoes-c-2.html [iclshoes.com] http://www.iclshoes.com/ [iclshoes.com] http://www.zentai-mart.com/Play-Costumes-c-5.html [zentai-mart.com] http://www.zentai-mart.com/Latex-Catsuits-Clothes-c-3.html [zentai-mart.com] http://www.zentai-mart.com/PVC-Catsuits-Clothes-c-6.html [zentai-mart.com] http://www.zentai-mart.com/ [zentai-mart.com] http://www.hereshoes.com/miu-miu-shoes-c-31.html [hereshoes.com] http://www.hereshoes.com/giuseppe-zanotti-c-43.html [hereshoes.com] http://www.hereshoes.com/lanvin-shoes-c-50.html [hereshoes.com] ...
- Christian Louboutin on Turning website favicons in to 3D
What are the charmings of?a href="http://www.iclshoes.com [iclshoes.com]cl shoes/a?They are quality,comfort and style.The a href=http://www.iclshoes.com/jimmy-choo-shoes-c-2.html [iclshoes.com]Jimmy Choo shoes/a are made from ...
- Christian Louboutin on Turning website favicons in to 3D
Thanks a lot for that: I had first tried sudo aptitude purge adobe-flashplugin then sudo aptitude install flashplugin-nonfree but that ...
Andre, the name is derived from the class name (camel case converted to lower case with underscores). But, you can ...
is this using some kind of name mangling to map sorethumb:rounded_corners_edged to the RoundedCornersEdged class? that seems a little unnecessary ...
 
© 2008 Will McGugan.

A technoblog blog, design by Will McGugan