PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Text » Text_Highlighter » Bug #4607

The span class="hl-brackets" shall not include the spaces before

Details

Request #4607The span class="hl-brackets" shall not include the spaces before
Submitted2005-06-16 14:51 UTC
Frompriplatv at netscape dot net
StatusClosed
PackageText_Highlighter
PHP Version5.0.3
OSWin XP but irrelevant
Roadmaps(Not assigned)

Comments

[2005-06-16 14:51 UTC] priplatv at netscape dot net

Description:
------------
Text_Highlighter version 0.6.5

With list numbering on and tabsize set, the span class="hl-brackets" includes the spaces (from the tabs) before the bracket, which does not nicely display in case the class set the background-color.

Reproduce code:
---------------
$src = <<< EOT
\t<p>Two paragraphs </p><p>correctly nested</p>
\t<p>Paragraph with correctly <em>emphasized</em> overlapping</p>
EOT;
echo $hl -> highlight($src);

Expected result:
----------------
<ol class="hl-main">
<li>  
<span class="hl-brackets"><</span>
<span class="hl-reserved">p</span>
<span class="hl-brackets">></span>
...
<span class="hl-brackets">></span>
</li>
<li>  
<span class="hl-brackets"><</span>
<span class="hl-reserved">p</span>
<span class="hl-brackets">></span>
...
<span class="hl-brackets">></span>
</li>
</ol>

Actual result:
--------------
<ol class="hl-main">
<li>   </span>
<span class="hl-brackets"><</span>
<span class="hl-reserved">p</span>
<span class="hl-brackets">></span>
...
<span class="hl-brackets">></span>
</li>
<li> 
<span class="hl-brackets">  <</span>
<span class="hl-reserved">p</span>
<span class="hl-brackets">></span>
...
<span class="hl-brackets">></span>
</li>
</ol>