Hello everyone,
Since I need line numbers, I have modified the code of DokuWiki.
But I had to make this change to a system file (
parserutils.php).
How can I include this one line properly without changing the actual code of DokuWiki? Maybe with a plugin?
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 2);
before:
(...)
} else {
$geshi = new GeSHi($code, $language);
$geshi->set_encoding('utf-8');
$geshi->enable_classes();
$geshi->set_header_type(GESHI_HEADER_PRE);
$geshi->set_link_target($conf['target']['extern']);
// remove GeSHi's wrapper element (we'll replace it with our own later)
// we need to use a GeSHi wrapper to avoid <BR> throughout the highlighted text
$highlighted_code = trim(preg_replace('!^<pre[^>]*>|</pre>$!','',$geshi->parse_code()),"\n\r");
io_saveFile($cache,$highlighted_code);
}
(...)
after:
(...)
} else {
$geshi = new GeSHi($code, $language);
$geshi->set_encoding('utf-8');
$geshi->enable_classes();
$geshi->set_header_type(GESHI_HEADER_PRE);
$geshi->set_link_target($conf['target']['extern']);
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 2);
// remove GeSHi's wrapper element (we'll replace it with our own later)
// we need to use a GeSHi wrapper to avoid <BR> throughout the highlighted text
$highlighted_code = trim(preg_replace('!^<pre[^>]*>|</pre>$!','',$geshi->parse_code()),"\n\r");
io_saveFile($cache,$highlighted_code);
}
(...)
Greetings
Kerad