|=|Header|=|Says||
||I'm||Awesome||
This is a highlighter that parses wikka markup, and then displays the resulting html code with
GeSHi's
html4strict highlighter.
The formatter is as follows, call it
wiki2html (or something else) and it is then callable by
%%(wiki2html)...%% or whatever you called it.
The strange '%'.'%' below is to avoid breaking out of the highlighter before I want to.
Exchange them with '%%(html4strict)'.$temp.'%%' in the file for righteousness! ;)
<?php
/**
* Highlighter for produced html from wikka code.
*
* @package Formatters
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
* @filesource
*
* @uses Wakka::Format()
*/
$temp = $this->Format($text);
$this->Format('%'.'%(html4strict)'.$temp.'%'.'%');
?>
In addition you need to change the wakka formatter for code highlighting in order to avoid double
grab buttons (near line 725 in formatters/wakka.php).
This should change nothing, except for wikka highlighters that uses Wakka::Format() - and then you're out sailing already ;)
// check Wikka highlighter path is set and if we have an internal Wikka highlighter
elseif (isset($language) &&
isset($wakka->config['wikka_formatter_path']) &&
file_exists($wikka_hi_path.DIRECTORY_SEPARATOR
.$language.'.php') &&
'wakka' != $language)
{
// use internal Wikka highlighter
$temp = '<div class="code">'."\n";
$temp .= $wakka->Format($code."\n", $language);
$temp .= '</div>'."\n";
if ($output == '') $output = $temp;
else return $output;
}