= RuBB
BBCode gem for Ruby.
RuBB parses BBCode by generating a parse tree, so it is able to handle nested BBCode tags properly.
== Install
gem install rubb
== Usage
RuBB.to_html('[b]hello[/b]')
'[b]hello[/b]'.bb_to_html
== BBCode Tags
RuBB supports the following BBCode tags:
[h1]text/[/h1] =>
[b]text[/b] => text
[i]text[/i] => text
[u]text[/u] => text
[s]text[/s] => text
[size=10]text[/size] => text [color=#ff0000]text[/color] => text
[left]text[/left] =>
[quote]text[/quote] =>
[quote=someone]text[/quote] =>text
- someone
text
[url]http://github.com/petejkim/rubb/[/url] => http://github.com/petejkim/rubb/ [url=http://github.com/petejkim/rubb/]RuBB[/url] => RuBB
[email]test@test.com[/email] => test@test.com [email=test@test.com]Test Email[/email] => Test Email
[img]http://test.com/test.jpg[/img] => [img=640x480]http://test.com/test.jpg[/img] =>
[ul][li]text[/li][/ul] =>
[code]text[/code] =>
text
[table][tr][th]text[/th][/tr][tr][td]text[/td][/tr][/table] =>
text |
---|
text |
== Copyright
Copyright (c) 2010 Peter Jihoon Kim. See LICENSE for details.