php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #42448 highlight_(string|file) does not include <pre>
Submitted: 2007-08-27 16:04 UTC Modified: 2010-12-31 20:43 UTC
From: geoffers at gmail dot com Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 5.2.3 OS: Mac OS 10.4.10
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-08-27 16:04 UTC] geoffers at gmail dot com
Description:
------------
The code highlight functions should output a surrounding <pre> element, 
as the content's meaning may be changed by normalising whitespace. A 
non-breaking space has a different meaning to whitespace having 
importance.

e.g., the two are different strings:
- 'This is a
test'
- 'This is a test'

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

highlight_string('foo  bar');

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

Actual result:
--------------
<pre><code><span style="color: #000000">
foo  bar</span>
</code></pre>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-31 20:43 UTC] jani@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 17:01:33 2024 UTC