ID:               32918
 Updated by:       [EMAIL PROTECTED]
 Reported By:      mpb dot mail at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Strings related
 Operating System: Gentoo Linux
 PHP Version:      5.0.3
 New Comment:

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

see #29338  


Previous Comments:
------------------------------------------------------------------------

[2005-05-02 23:59:51] mpb dot mail at gmail dot com

Description:
------------
The highlight_string function fails to properly indent lines that begin
with a single space.

I suspect highlight_file has the same problem, but have not tested it.

In the reproduce code (below), the line ' *' actually renders as:

<br /> *<br />

Instead of the expected:

<br />&nbsp;*<br />

So, I guess if a line begins with a single space, that space needs to
be converted into '&nbsp;' even though it is a singleton.

Reproduce code:
---------------
<?php

$comment = array ('/*', '*', ' *', '  *', "\t*/");
$comment = join ("\n", $comment);
highlight_string ($comment);

?>


Expected result:
----------------
<code><span style="color: #000000">
/*<br />*<br />&nbsp;*<br />&nbsp;&nbsp;*<br
/>&nbsp;&nbsp;&nbsp;&nbsp;*/</span>
</code>


Actual result:
--------------
<code><span style="color: #000000">
/*<br />*<br /> *<br />&nbsp;&nbsp;*<br
/>&nbsp;&nbsp;&nbsp;&nbsp;*/</span>
</code>



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=32918&edit=1

Reply via email to