BBCode

Synopsis

The BBCode module helps ease the separation of core and frontend with the core (or submodules) being still able to say, what colors shall be used in it‘s responses. This is achieved by encoding formatting information using the BBCode tokens. This enables you to "pipe" layout information such as colors, style, fonttype, size and alignment through the core to the frontend.

Additionally it converts markups/codes between ANSI, HTML and BBCode almost freely ;)

Usage

  # Converting a bbcode string to ANSI and XHTML

  str = "this is [COLOR=red]red[/COLOR], this is [B]bold[/B]"
  print( BBCode.bbcode_to_ansi(str) )
  print( BBCode.bbcode_to_html(str) )

Authors

  • Thomas-Ivo Heinen

Copying

Copyright (c) 2002 Thomas-Ivo Heinen

Ruby License

This module is free software. You may use, modify, and/or redistribute this software under the same terms as Ruby.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.