nlopess Tue Sep 7 07:06:11 2004 EDT
Modified files: /phpdoc/htmlhelp filter_files.php Log: minor cleanup and PHP 5 support http://cvs.php.net/diff.php/phpdoc/htmlhelp/filter_files.php?r1=1.3&r2=1.4&ty=u Index: phpdoc/htmlhelp/filter_files.php diff -u phpdoc/htmlhelp/filter_files.php:1.3 phpdoc/htmlhelp/filter_files.php:1.4 --- phpdoc/htmlhelp/filter_files.php:1.3 Sat Sep 6 09:27:30 2003 +++ phpdoc/htmlhelp/filter_files.php Tue Sep 7 07:06:08 2004 @@ -267,14 +267,9 @@ $example = str_replace( array(">", "<", "&", """), array(">", "<", "&", "\""), - $pre_found[2] + trim($pre_found[2]) ); - // Trim example code to get rid of extra line breaks - $example = trim($example); - - // Start output buffer, add PHP tags if none is there - ob_start(); if (!strstr($example, "<?php")) { $example = "<?php " . $example . " ?>"; $delimiter = FALSE; @@ -283,9 +278,7 @@ } // Get highlited source code - highlight_string($example); - $colored_example = ob_get_contents(); - ob_end_clean(); + $colored_example = highlight_string($example, true); // Strip out PHP delmiter, if we added it if (!$delimiter) { @@ -311,8 +304,8 @@ // Pre container to strip out uneeded font tags $colored_example = '<pre>' . $colored_example . '</pre>'; $colored_example = str_replace( - array('<pre><font color="#000000">', '</font></pre>'), - array('', ''), + array('<pre><font color="#000000">', '<pre><span style="color: #000000">', '</font></pre>', '</span></pre>'), + array('', '', '', ''), $colored_example );