<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>File: bbcode.rb</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> <script type="text/javascript"> // <![CDATA[ function popupCode( url ) { window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") } function toggleCode( id ) { if ( document.getElementById ) elem = document.getElementById( id ); else if ( document.all ) elem = eval( "document.all." + id ); else return false; elemStyle = elem.style; if ( elemStyle.display != "block" ) { elemStyle.display = "block" } else { elemStyle.display = "none" } return true; } // Make codeblocks hidden by default document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) // ]]> </script> </head> <body> <div id="fileHeader"> <h1>bbcode.rb</h1> <table class="header-table"> <tr class="top-aligned-row"> <td><strong>Path:</strong></td> <td>lib/carat/bbcode.rb </td> </tr> <tr class="top-aligned-row"> <td><strong>Last Update:</strong></td> <td>Tue Dec 07 01:58:01 EST 2004</td> </tr> </table> </div> <!-- banner header --> <div id="bodyContent"> <div id="contextContent"> <div id="description"> <h1><a href="../../../classes/BBCode.html">BBCode</a></h1> <p> This module helps easening 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 <a href="../../../classes/BBCode.html">BBCode</a> tokens. This enables you to "pipe" layout information such as colors, style, fonttype, size and alignment through the core to the frontend. </p> <p> Additionally it converts markups/codes between ANSI, <a href="../../../classes/HTML.html">HTML</a> and <a href="../../../classes/BBCode.html">BBCode</a> almost freely ;) </p> <h2>Example</h2> <pre> # Converting a string to ANSI and XHTML require 'raspberry/new/bbcode' str = "this is [COLOR=red]red[/COLOR], this is [B]bold[/B]" print( BBCode.bbcode_to_ansi(str) ) print( BBCode.bbcode_to_html(str) ) </pre> <h1>Author</h1> <ul> <li>Thomas-Ivo Heinen </li> </ul> <h2>Legal</h2> <pre> Copyright (c) 2002 Thomas-Ivo Heinen </pre> <h2>History</h2> <pre> 02-07-16 Bugfix BBCODE=>ANSI, bbcode_to_html, ansi_to_html, html_to_bbcode, html_to_ansi 02-11-11 Comment fixes, more case insensitive matching, convert deprecated HTML styles (<b>, <i>), more space-tolerant matching, img-tags in html_to_bbcode works now, some error-preventing stripping and downcasing. </pre> <h2>Stamp</h2> <pre> $Id: bbcode.rb, v2.2 2002/07/16 transami Exp $ </pre> </div> </div> </div> <!-- if includes --> <div id="section"> <!-- if method_list --> </div> <div id="validator-badges"> <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> </div> </body> </html>