Merge lp:~benji/launchpadlib/fix-nested-p-tags into lp:launchpadlib
Status: | Merged |
---|---|
Approved by: | Benji York |
Approved revision: | 104 |
Merge reported by: | Benji York |
Merged at revision: | not available |
Proposed branch: | lp:~benji/launchpadlib/fix-nested-p-tags |
Merge into: | lp:launchpadlib |
Diff against target: |
53 lines (+20/-4) 3 files modified
src/launchpadlib/NEWS.txt (+5/-0) src/launchpadlib/__init__.py (+1/-1) src/launchpadlib/wadl-to-refhtml.xsl (+14/-3) |
To merge this branch: | bzr merge lp:~benji/launchpadlib/fix-nested-p-tags |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | code | Approve | |
j.c.sackett (community) | code* | Approve | |
Review via email: mp+42489@code.launchpad.net |
Description of the change
The HTML generated by the XSLT did not validate because it contained
nested <p> tags (bug 426858). That was because the contents of
<wadl:doc> nodes were unconditionally wrapped in a <p>.
This branch adds a conditional to the <wadl:doc> template so that
<wadl:doc> nodes with <p> child nodes are instead wrapped in a <div>.
Why a <div> instead of no containing tag at all? For some reason the
output stage of the XSLT processor generates overly-compact HTML (no
inter-tag whitespace) if there isn't a block-level tag containing the
children of the <wadl:doc> node. I wish I knew exactly why that was.
The generated HTML validates and when rendered is virtually identical to
the original (there are a few subtle white-space differences).
Looks good. I wish there were some sort of test set for all of this, but perhaps that will come when we move some of this to LP, as you mentioned.