|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-05-22 19:00 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 19:00:01 2025 UTC |
Description: ------------ The highlight_file() and highlight_string() functions don't translate the leading space of a line to when this line has exactly one leading space (or identation space if you prefer). As web browsers don't display leading spaces of a line (that are not of course), this single leading space then disapears on the output visible in the browser. When there are two or more spaces, they are all correctly translated to however, and the identation is visible. Reproduce code: --------------- highlight_string('<?php no_leading_space($test); one_leading_space($test); two_leading_spaces($test); three_leading_spaces($test); four_leading_spaces($test); ?>'); Expected result: ---------------- <?php no_leading_space($test); one_leading_space($test); two_leading_spaces($test); three_leading_spaces($test); four_leading_spaces($test); ?> with HTML source (excerpt): ... <font color="#007700">);<br /> </font><font color="#0000BB">one_leading_space</font> ... Actual result: -------------- <?php no_leading_space($test); one_leading_space($test); two_leading_spaces($test); three_leading_spaces($test); four_leading_spaces($test); ?> with HTML source (excerpt): ... <font color="#007700">);<br /> </font><font color="#0000BB">one_leading_space</font> ...