Source for file _gmcode.renderer.php
Documentation is available at _gmcode.renderer.php
* This file implements the GMcode plugin for b2evolution
* GreyMatter style formatting
* b2evolution - {@link http://b2evolution.net/}
* Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
* @copyright (c)2003-2005 by Francois PLANQUE - {@link http://fplanque.net/}
if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );
require_once dirname(__FILE__
).
'/../renderer.class.php';
* GreyMatter formatting search array
'# \*\* (.+?) \*\* #x', // **bold**
'# \x5c\x5c (.+?) \x5c\x5c #x', // \\italics\\
'# (?<!:) \x2f\x2f (.+?) \x2f\x2f #x', // //italics// (not preceded by : as in http://)
'# __ (.+?) __ #x', // __underline__
'/ \#\# (.+?) \#\# /x', // ##tt##
( \s*? \n )? # Eat optional blank line after %%%
( \n \s*? )? # Eat optional blank line before %%%
'<span style="text-decoration:underline">$1</span>',
'<div class="codeblock"><pre><code>$2</code></pre></div>'
* {@internal gmcode_Rendererplugin::gmcode_Rendererplugin(-)}}
$this->long_desc =
T_('**bold** \\italics\\ //italics// __underline__ ##tt## %%codeblock%%');
* {@internal gmcode_Rendererplugin::render(-)}}
* @param string content to render (by reference) / rendered content
* @param string Output format, see {@link format_to_output()}
* @return boolean true if we can render something for the required output format
function render( & $content, $format )
if( ! parent::render( $content, $format ) )
{ // We cannot render the required format
$content =
preg_replace( $this->search, $this->replace, $content );