No release in over 3 years
Low commit activity in last 3 years
Convert BBCode to Markdown and check whether the BBCode is valid.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

Ruby-BBcode-to-MD

This gem converts BBcode to Markdown. BBcode is parsed before conversion, checking whether the BBcode is valid.

The parser recognizes most "official tags":http://www.bbcode.org/reference.php and allows to easily extend this set with custom tags by editing tags.rb.

Example

"This is [b]bold[/b] and this is [i]italic[/i].".bbcode_to_md

=>

This is **bold** and this is *italic*.

Installation

Add this to your Rails app's Gemfile

gem 'ruby-bbcode-to-md'

or use the repo link

gem 'ruby-bbcode-to-md', :git => git://github.com/rikkit/ruby-bbcode-to-md.git

Then run

bundle install

And the gem is available in your application

Note: Do not forget to restart your server!

Development

Known issues

  • The parser doesn't handle nested quotes correctly.

Testing

Run

bundle install
bundle exec rake test

in the source directory to run the unit tests. Edit ruby_bbcode_test.rb to add tests.

Acknowledgements

Code is based on BBcode to HTML gem by Maarten Bezemer: http://github.com/veger/ruby-bbcode.git

Some of the ideas and the tests came from "bb-ruby":http://github.com/cpjolicoeur/bb-ruby of Craig P Jolicoeur

Licence

MIT Licence. See the included MIT-LICENCE file.