Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5047 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13156 invoked by uid 1010); 28 Oct 2003 19:39:11 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 13120 invoked from network); 28 Oct 2003 19:39:10 -0000 Received: from unknown (HELO thedoh.com) (24.93.8.67) by pb1.pair.com with SMTP; 28 Oct 2003 19:39:10 -0000 Received: from lisa.thedoh.com (lisa.thedoh.com [192.168.0.11]) by thedoh.com (Postfix) with ESMTP id 5E20514AE3A for ; Tue, 28 Oct 2003 14:36:28 -0500 (EST) Reply-To: lisa@gentoo.org To: internals@lists.php.net Content-Type: multipart/mixed; boundary="=-Nn1vsyAXYngJd57bW6+m" Message-ID: <1067369954.17263.15.camel@lisa.thedoh.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Tue, 28 Oct 2003 14:39:14 -0500 Subject: [PATCH][ZE2] zend_highlight.c change From: lisa@gentoo.org (Lisa Seelye) --=-Nn1vsyAXYngJd57bW6+m Content-Type: text/plain Content-Transfer-Encoding: 7bit Attached is a patch to change the behavior of source highlighting functions to use instead of . This patch also introduces \n and \t when the parser encounters one (this change is mainly for readability). The reasoning is: the tag is depreciated[1], and \n and \t should be preserved, and not just translated into
and  's (respectively). [1]: http://www.w3.org/TR/html4/present/graphics.html#edef-FONT Please CC me on replies. -- Regards, -Lisa --=-Nn1vsyAXYngJd57bW6+m Content-Disposition: attachment; filename=zend_highlight.c.diff Content-Type: text/x-patch; name=zend_highlight.c.diff; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --- cvs/ZendEngine2/zend_highlight.c 2003-08-11 01:24:41.000000000 -0400 +++ cvs-diff/ZendEngine2/zend_highlight.c 2003-10-28 14:05:59.000000000 -0500 @@ -30,7 +30,7 @@ { switch (c) { case '\n': - ZEND_PUTS("
"); + ZEND_PUTS("
\n"); break; case '<': ZEND_PUTS("<"); @@ -45,7 +45,7 @@ ZEND_PUTS(" "); break; case '\t': - ZEND_PUTS("    "); + ZEND_PUTS("    \t"); break; default: ZEND_PUTC(c); @@ -104,8 +104,8 @@ char *next_color; int in_string=0; - zend_printf(""); - zend_printf("\n", last_color); + zend_printf("\n"); + zend_printf("\n", last_color); /* highlight stuff coming back from zendlex() */ token.type = 0; while ((token_type=lex_scan(&token TSRMLS_CC))) { @@ -151,11 +151,11 @@ if (last_color != next_color) { if (last_color != syntax_highlighter_ini->highlight_html) { - zend_printf(""); + zend_printf("
"); } last_color = next_color; if (last_color != syntax_highlighter_ini->highlight_html) { - zend_printf("", last_color); + zend_printf("", last_color); } } switch (token_type) { @@ -192,10 +192,10 @@ token.type = 0; } if (last_color != syntax_highlighter_ini->highlight_html) { - zend_printf("\n"); + zend_printf("\n"); } - zend_printf("\n"); - zend_printf(""); + zend_printf("\n"); + zend_printf("\n"); } @@ -264,4 +264,3 @@ * indent-tabs-mode: t * End: */ - --=-Nn1vsyAXYngJd57bW6+m--