From:             mg at iceni dot pl
Operating system: any
PHP version:      Irrelevant
PHP Bug Type:     Unknown/Other Function
Bug description:  syntax highlighter uses obsolete <font>

Description:
------------
syntax highlighter uses <font> which is removed in xhtml. 

nl2br is already xhtml compilant so highlight_[string|

file] should be too. 

 

Here is simple patch (for php4 and php5) which replaces 

<font> with <span> 

 

diff -u2 Zend/zend_highlight.c 

Zend-patched/zend_highlight.c 

--- Zend/zend_highlight.c       2004-01-08 

18:31:47.000000000 +0100 

+++ Zend-patched/zend_highlight.c       2004-02-25 

14:17:41.154198944 +0100 

@@ -106,5 +106,5 @@ 

 

        zend_printf("<code>"); 

-       zend_printf("<font color=\"%s\">\n", last_color); 

+       zend_printf("<span style=\"color: %s\">\n", 

last_color); 

        /* highlight stuff coming back from zendlex() */ 

        token.type = 0; 

@@ -150,9 +150,9 @@ 

                if (last_color != next_color) { 

                        if (last_color != 

syntax_highlighter_ini->highlight_html) { 

-                               zend_printf("</font>"); 

+                               zend_printf("</span>"); 

                        } 

                        last_color = next_color; 

                        if (last_color != 

syntax_highlighter_ini->highlight_html) { 

-                               zend_printf("<font 

color=\"%s\">", last_color); 

+                               zend_printf("<span 

style=\"color: %s\">", last_color); 

                        } 

                } 

@@ -185,7 +185,7 @@ 

        } 

        if (last_color != 

syntax_highlighter_ini->highlight_html) { 

-               zend_printf("</font>\n"); 

+               zend_printf("</span>\n"); 

        } 

-       zend_printf("</font>\n"); 

+       zend_printf("</span>\n"); 

        zend_printf("</code>"); 

 } 

 


-- 
Edit bug report at http://bugs.php.net/?id=27393&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27393&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27393&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27393&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27393&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27393&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27393&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27393&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27393&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27393&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27393&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27393&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27393&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27393&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27393&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27393&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27393&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27393&r=float

Reply via email to