Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.8.0

Bug #3060 Wrong render with HL_NUMBERS_TABLE option
Submitted: 2004-12-30 15:12 UTC
From: farell Assigned: blindman
Status: Closed Package: Text_Highlighter
PHP Version: 4.3.9 OS: Windows XP
Roadmaps: (Not assigned)    
Subscription  


 [2004-12-30 15:12 UTC] farell
Description: ------------ I've discovered today a wrong render with HL_NUMBERS_TABLE option and a particular phpdoc tags unitcase. The number on left side of the table are asynchronous with content on right side. It's seems to happens only when, in a php comment line we found a ending line content that is not a comment-content itself. My Example : file content of 'hl_comment.php' (see reproduce code) <?php /** * An example of ... * * * @package HTML_Progress2 * @link http://www.qarbon.com * @access public */ ?> If you have a CRLF just after the .com of url in @link phpdoc tag, we got the wrong render. Add a blank after .com and just before a CRLF will fixed the render problem. I think the problem is in the acceptToken() method of html renderer, but it's up to you Andrey, to see if i'm wrong or not ! I've passed the test with browsers below: - opera 7.11 - IE 6 SP2 (only this one give a nice render with problem; i begin to hate IE ;-) - Mozilla 1.7.3 - FireFox 1.0 Hope it will help ! Reproduce code: --------------- <?php include_once 'Text/Highlighter.php'; $file = 'hl_comment.php'; $hl =& Text_Highlighter::factory('PHP',array('numbers'=>HL_NUMBERS_TABLE)); $code = file_get_contents($file); $html = $hl->highlight($code); echo $html; ?> Expected result: ---------------- 1 <?php 2 /** 3 * An example of ... 4 * 5 * 6 * @package HTML_Progress2 7 * @link http://www.qarbon.com 8 * @access public 9 */ 10 ?> Actual result: -------------- 1 <?php 2 /** 3 * An example of ... 4 * 5 * 6 * @package HTML_Progress2 7 * @link http://www.qarbon.com 8 9 * @access public 10 */ ?>

Comments

 [2005-02-02 11:44 UTC] blindman
I do not have IE 6 with SP2 by hand. Can you provide HTML code that would render as expected?
 [2005-02-03 17:48 UTC] farell
Here are the html code with ie 6 sp2 that should render as expected : <pre> <table class="hl-table" width="100%"><tr><td class="hl-gutter" align="right" valign="top" style="width:4ex;"><pre>1 2 3 4 5 6 7 8 9 10 </pre></td><td class="hl-main" valign="top"><pre><span class="hl-inlinetags"><?php </span><span class="hl-comment">/** * An example of ... * * *</span><span class="hl-inlinedoc"> @package </span><span class="hl-comment"> HTML_Progress2 *</span><span class="hl-inlinedoc"> @link </span><span class="hl-url">http://www.qarbon.com </span><span class="hl-comment"> *</span><span class="hl-inlinedoc"> @access </span><span class="hl-comment"> public */ </span><span class="hl-inlinetags">?></span></pre></td></tr></table> </pre>
 [2005-02-04 06:00 UTC] blindman
Text is wrapped here, and newline positions are important. Could you post a link to HTML code?
 [2005-02-04 07:16 UTC] blindman
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/Text_Highlighter