Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.9.1
-
Fix Version/s: 1.10
-
Labels:None
-
Environment:?
-
Number of attachments :
Description
In the current version of the xdoc plugin, a <a name="sectionName"> element is generated for every sub/section from its corresponding
name tag. This may lead to an invalid HTML document if some sub/sections have the same name, because according to the HTML 4.01 specs ( http://www.w3.org/TR/html4/struct/links.html#h-12.2.1 ), anchor names must be unique within one document. For the xdoc plugin this is not a big problem
because browsers usually ignore identical ids, but we are having troubles for the pdf plugin (see MPPDF-40) where identical ids lead to a
build failure.
I suggest to generate an id from an optional id tag as in the following example:
<section name="Section 1">
<subsection name="SubSection" id="SubSection1">
</subsection>
</section>
<section name="Section2">
<subsection name="SubSection" id="SubSection2">
</subsection>
</section>
so the section title is constructed from the name tag while the id tag (which has to be unique) may be used to reference the section.
I attach a patch to achieve this, if this gets accepted I can easily adjust the pdf plugin accordingly.
The only worry is backwards compatibility: xdocs that use the old feature of referencing sections by names, will produce invalid links.
However, I haven't seen this feature documented anywhere, I don't think it is widely used and therefore, it should not be a big problem.
Issue Links
- is related to
-
MPXDOC-159
Allow users to provide 'href' attribute to be used a section or subsection anchor
-
As this will totally break backwards compablity I would say that the xdoc plugin should just warn and ignore any repeated headings.