php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60224 div nesting in html docs
Submitted: 2011-11-05 13:50 UTC Modified: 2021-07-13 14:05 UTC
From: indy at spikehead dot co dot uk Assigned:
Status: Analyzed Package: Doc Build problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2011-11-05 13:50 UTC] indy at spikehead dot co dot uk
Description:
------------
I've been looking at the "alpha" or "beta" epub docs (depending what you call them). These are failing on my ereader, and after pushing the epub through a validator, there are a lot element errors. These are present on the HTML pages as well.

Basically these are all nested elements (div, ul, p) within a P tag (which you can't do). The code snippet below is from the "What is PHP page". Around half of the occurances are this simple and the enclosing p tag removed.

There are a lot of others where there are several instances of incorrect nesting in a paragraph, which need the closing p tag moving to the correct location.

Test script:
---------------
   <p class="para">
    <div class="example" id="example-1">
     <div class="info"><p><b>Example #1 An introductory example</b></p></div>
     <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
&lt;!DOCTYPE&nbsp;HTML&nbsp;PUBLIC&nbsp;"-//W3C//DTD&nbsp;HTML&nbsp;4.01&nbsp;Transitional//EN"<br />&nbsp;&nbsp;&nbsp;&nbsp;"http://www.w3.org/TR/html4/loose.dtd"&gt;<br />&lt;html&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;head&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;Example&lt;/title&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;/head&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;body&gt;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"Hi,&nbsp;I'm&nbsp;a&nbsp;PHP&nbsp;script!"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">?&gt;<br /></span><br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;/body&gt;<br />&lt;/html&gt;</span>
</code></div>
     </div>

    </div>
   </p>



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-07-13 14:05 UTC] cmb@php.net
-Status: Open +Status: Analyzed
 [2021-07-13 14:05 UTC] cmb@php.net
PhD renders <para> as <p> instead of the appropriate <div> (or
maybe <section>).  This cannot be easily changed, because the docs
use <para> all the time, albeit <simpara> would be more
appropriate.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC