|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-05-03 09:36 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 10:00:01 2025 UTC |
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 /> *<br /> So, I guess if a line begins with a single space, that space needs to be converted into ' ' 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 /> *<br /> *<br /> */</span> </code> Actual result: -------------- <code><span style="color: #000000"> /*<br />*<br /> *<br /> *<br /> */</span> </code>