Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/petejkim/rubb
- Owner: petejkim
- License: mit
- Created: 2010-07-12T10:25:23.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2010-08-02T01:58:55.000Z (over 14 years ago)
- Last Synced: 2024-09-17T23:24:21.826Z (about 2 months ago)
- Language: Ruby
- Homepage:
- Size: 89.8 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.rdoc
- License: LICENSE
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] =>
- 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.