I mean I would like to post something like:
also I would php code to be highlighted by highlight_string() php function.<?php
// comment
$foo = 'bar';
?>
I have a way to do that, but it's not clear to me how to bundle it within s9y source and if it has some limitation because of something I'm not aware of.
here is the idea. when printing an entry you should do:
also should be set a function like:$entry = preg_replace_callback('/<\?php(.*)\?>/s', 'entry_highlight_code', $entry);
is there any phpBB tag that could be used as well?function entry_highlight_code($matches) {
// <pre> tags is preferred to <code> and there are too many <p> tags,
// but there's no way to override highlight_string() behaviour,
// so I used the following workaround
return sprintf("<pre>%s</pre>", preg_replace('/<br \/>|<p>|<\/p>|<code>|<\/code>/', '',
highlight_string($matches[0], true)));
}
bye, alberto.