]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/map_generates_malformed_HTML.mdwn
i have a patch for this now
[ikiwiki.git] / doc / bugs / map_generates_malformed_HTML.mdwn
1 [[!template id=gitbranch branch=smcv/ready/map author="[[Simon McVittie|smcv]]"]]
2 [[!tag patch]]
3
4 `\[[!map]]` can generate bad HTML with unbalanced open/close tags
5 (in XML terms: "not well-formed") in certain situations. This
6 appears to be a regression caused by fixing
7 [[maps with nested directories sometimes make ugly lists]], which
8 suppressed some redundant `</ul><ul>` pairs, but appears not to
9 have the ideal logic for this, leading to malformed HTML.
10
11 In particular, on a site with these pages:
12
13 * alpha
14     * 1
15         * i
16         * ii
17         * iii
18         * iv
19     * 2
20         * a
21         * b
22     * 3
23 * beta
24
25 the maps "`alpha/1 or beta`", "`alpha/1/i* or alpha/2/a or beta`" and
26 "`alpha/1/i* or alpha/2/a`" have malformed HTML.
27
28 My `ready/map` branch adds a regression test and makes it pass.
29
30 The fix is not particularly elegant - it generates the previous
31 HTML with redundant `</ul><ul>` pairs, marks the redundant
32 pairs, and edits them out afterwards - but it works. If anyone can come
33 up with a cleaner algorithm that avoids generating the redundant tags
34 in the first place, that would be even better. --[[smcv]]
35
36 > [[merged|done]] (not thrilled at this solution, but it works) --[[Joey]]