|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-02-25 08:32 UTC] derick@php.net
[2004-02-25 08:47 UTC] mg at iceni dot pl
[2004-02-25 09:07 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 07:00:01 2025 UTC |
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>"); }