Wiki source for OnegWRNoDefaultCodeClass


Show raw source

===== NoDefaultCodeClass Workaround =====
>>==See Also==
~- [[OnegWRHide | Hide]]
~- [[OnegWRCsv | CSV]]
>>//NOT Included in any Wikka version yet//{{lastedit}}
==What==
~- By default is every call to a script in the formatters/ dir wrapped by a <div class="code">, this provides the yellow background (that I don't want in some scripts).
~- Here you'll find my workaround.
~- Note: If you do want some scripts in the formatters/ directory to use the code class, you will need to add it in evry script individualy...

==Installation==
~- Open the file ##formatters/wakka.php##
~- and replace as described below...

==Find this code (around 60%)==
%%(php)
elseif (isset($language) && isset($wakka->config['wikka_formatter_path']) && file_exists($wikka_hi_path.'/'.$language.'.php') && 'wakka' != $language)
{
// use internal Wikka hilighter
$output = '<div class="code">'."\n";
$output .= $wakka->Format($code, $language);
$output .= "</div>\n";
}
// no language defined or no formatter found: make default code block;
// IncludeBuffered() will complain if 'code' formatter doesn't exist
else
{
$output = '<div class="code">'."\n";
$output .= $wakka->Format($code, 'code');
$output .= "</div>\n";
}

return $output;
%%
==And replace it with==
%%(php)
elseif (isset($language) && isset($wakka->config['wikka_formatter_path']) && file_exists($wikka_hi_path.'/'.$language.'.php') && 'wakka' != $language)
{
// use internal Wikka hilighter
//$output = '<div class="code">'."\n";
$output = '<div>'; //only this line...
$output .= $wakka->Format($code, $language);
$output .= "</div>\n";
}
// no language defined or no formatter found: make default code block;
// IncludeBuffered() will complain if 'code' formatter doesn't exist
else
{
$output = '<div class="code">'."\n";
$output .= $wakka->Format($code, 'code');
$output .= "</div>\n";
}

return $output;
%%
==History==
~- Published on main site (2005-05-09) - OnegWR

----
OnegWR
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki