#41223 [Opn->Bgs]: PHP should output better HTML for the .phps (highlight source) view
| From: | iliaa@php.net | Date: | Sun, 29 Apr 2007 14:39:44 +0000 |
| Subject: | #41223 [Opn->Bgs]: PHP should output better HTML for the .phps (highlight source) view | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-112041@lists.php.net to get a copy of this message | ||
ID: 41223
Updated by: iliaa@php.net
Reported By: jeremy dot visser at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Output Control
Operating System: Ubuntu 7.04
PHP Version: 5.2.1
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
The reason there are no headers is because the expectation is that the
output will be embed in an existing page. Presence of the requested
headers and elements would then cause the page to break.
Previous Comments:
------------------------------------------------------------------------
[2007-04-29 09:22:35] jeremy dot visser at gmail dot com
Description:
------------
When PHP outputs highlighted source, the HTML it outputs is ugly. It
looks pretty when viewed in a browser, but the actual HTML is bad.
For starters, it doesn't use a DOCTYPE, and includes no <html>, <head>,
or <body> elements like you'd expect.
Even worse, it preformats the text not with a <pre> tag like should be
used, but with several 's to space text out. What is wrong with
using <pre>?
Expected result:
----------------
Should be using proper HTML headers:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en" lang="en">
<head>
<title>test.phps</title>
</head>
<body>
<pre class="php">
<?php
/* This is some PHP */
?>
</pre>
</body>
</html>
You see, when you use a <pre>, you don't need all these 's
to space things out.
Actual result:
--------------
Example of ugly code:
<span style="color: #0000BB"><?php<br
/> </span><span style="color:
#FF8000">/*<br
/> Test<br
/> */<br />?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41223&edit=1