ID: 27393 User updated by: mg at iceni dot pl Reported By: mg at iceni dot pl -Status: Feedback +Status: Open Bug Type: Unknown/Other Function Operating System: any PHP Version: Irrelevant New Comment:
http://iceni.pl/highlight.patch Previous Comments: ------------------------------------------------------------------------ [2004-02-25 08:32:37] [EMAIL PROTECTED] Please provide a link to the patch as it got garbled here. ------------------------------------------------------------------------ [2004-02-25 08:21:02] mg at iceni dot pl 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 this bug report at http://bugs.php.net/?id=27393&edit=1
