Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5058 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45411 invoked by uid 1010); 29 Oct 2003 05:44:30 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 45367 invoked from network); 29 Oct 2003 05:44:30 -0000 Received: from unknown (HELO titanium.nocdirect.com) (66.227.56.6) by pb1.pair.com with SMTP; 29 Oct 2003 05:44:30 -0000 Received: from 66-65-38-11.nyc.rr.com ([66.65.38.11] helo=chiaraquartet.net) by titanium.nocdirect.com with asmtp (Exim 4.24) id 1AEj88-00038k-UL; Tue, 28 Oct 2003 23:44:29 -0600 Message-ID: <3F9F53CB.107@chiaraquartet.net> Date: Wed, 29 Oct 2003 00:44:43 -0500 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: lisa@gentoo.org CC: internals@lists.php.net References: <1067369954.17263.15.camel@lisa.thedoh.com> In-Reply-To: <1067369954.17263.15.camel@lisa.thedoh.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - titanium.nocdirect.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - chiaraquartet.net Subject: Re: [PATCH][ZE2] zend_highlight.c change From: greg@chiaraquartet.net (Greg Beaver) Hi, At the very least, the portion that adds in \n to
is necessary to fix a bug in Internet Explorer experienced by PEAR documentation users. The source code examples in the manual at pear.php.net are highlighted with highlight_string(), and the lack of \n causes the rendered page examples (not HTML source - viewable graphical text) to cut-and-paste as a single line, something very annoying to deal with. Regards, Greg Lisa Seelye wrote: > 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. > > > ------------------------------------------------------------------------ > > --- 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: > */ > -