Since I’m using the WP-Syntax plug-in on my blog I tried to optimize font size and the tab width. Like a lot of developers I heavily use tabs in my source code. These tabs are really wide within the browser so I was looking for a way to minimize the used space.
I’m not a CSS guy but it seems like there is no way to set a specific tab width. So why not replace the tab with white space?
My change to wp-syntax/wp-syntax.php:
function wp_syntax_highlight($match) { global $wp_syntax_matches; $i = intval($match[1]); $match = $wp_syntax_matches[$i]; $language = strtolower(trim($match[1])); $line = trim($match[2]); $escaped = trim($match[3]); $code = wp_syntax_code_trim($match[4]); // INSERT JUST THIS LINE OF CODE $code = str_replace ( '\t' , ' ' , $code ); . . .
You must be logged in to post a comment.