Giter Club home page Giter Club logo

ruby-bbcode-to-md's Introduction

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_html

=>

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.

ruby-bbcode-to-md's People

Contributors

thenotary avatar veger avatar rikkit avatar nlalonde avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.