Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/petejkim/rubb

BBCode Parser for Ruby that supports nested BBCode tags.
https://github.com/petejkim/rubb

Last synced: about 1 month ago
JSON representation

BBCode Parser for Ruby that supports nested BBCode tags.

Awesome Lists containing this project

README

        

= 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] =>

text


[h2]text/[/h2] =>

text


[h3]text/[/h3] =>

text


[h4]text/[/h4] =>

text


[h5]text/[/h5] =>
text

[h6]text/[/h6] =>
text


[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] =>
text

[center]text[/center] =>
text

[right]text[/right] =>
text


[quote]text[/quote] =>

text


[quote=someone]text[/quote] =>

someone

text




[url]http://github.com/petejkim/rubb/[/url] => http://github.com/petejkim/rubb/
[url=http://github.com/petejkim/rubb/]RuBB[/url] => RuBB

[email][email protected][/email] => [email protected]
[[email protected]]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] =>
  • text

[ol][li]text[/li][/ol] =>
  1. text


[code]text[/code] =>
text


[table][tr][th]text[/th][/tr][tr][td]text[/td][/tr][/table] => texttext

== Copyright

Copyright (c) 2010 Peter Jihoon Kim. See LICENSE for details.