gringo, By default, Geshi wraps code blocks in pre tags (header_type = GESHI_HEADER_PRE). In this mode, tabs are not substituted for spaces, so the browser is displaying the tab directly and the width is browser dependent.
Personally, I avoid tabs like the plague in my source code, but if you’re not like me, you can try setting the header type to GESHI_HEADER_DIV. For example:
$geshi->set_header_type(GESHI_HEADER_DIV);
$geshi->set_tab_width(2);
Note, this will probably require that you modify your CSS styling afterwards.
To make this change without modifying the wp-syntax source directly, you can add your own custom plugin that contains code like this:
<?php
add_action('wp_syntax_init_geshi', 'geshi_change_tabs');
function geshi_change_tabs(&$geshi)
{
$geshi->set_header_type(GESHI_HEADER_DIV);
$geshi->set_tab_width(2);
}
?>
Thread Starter
gringo
(@gringo)
dear rmm5t, your help is very much appreciated.
Since I’m too much of a bimbo with word press and its plugins I didn’t manage to add my own plugin. But, as I can avoid tabs from the begining (as you mentioned) by converting them into spaces I no longer have this problem. My Textpad editor allows me to do so very nicely).
However, I still want to figure out what you actually meant with GESHI_HEADER_DIV and how to implemnt my own plugins….can’t be that hard, right?!