Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

disenchant/ruby-bbcode

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

174 Commits
174 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby-BBcode

This gem adds support for BBCode to Ruby. The BBCode is parsed by a parser before converted to HTML, allowing to convert nested BBCode tags in strings to their correct HTML equivalent. The parser also checks whether the BBCode is valid and gives errors for incorrect BBCode texts.

The parser recognizes all official tags and allows to easily extend this set with custom tags.

Example

'This is [b]bold[/b] and this is [i]italic[/i].'.bbcode_to_html
 => 'This is <strong>bold</strong> and this is <em>italic</em>.'

Installing

Add the folling line to the Gemfile in your Rails application:

gem 'ruby-bbcode'

Or grab it directly from the repository:
gem 'ruby-bbcode', :git => 'git://github.com/veger/ruby-bbcode.git'

Run
bundle install

And the gem is available in your application

Note: Do not forget to restart your server!

Acknowledgements

Some of the ideas and the tests came from bb-ruby of Craig P Jolicoeur

License

MIT License. See the included MIT-LICENCE file.

About

Convert BBCode to HTML and check whether the BBCode is valid

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.