X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/d17bce8bb2b2cf375e1acd13d9f5ea706f13215f..de754113b5fb4e4e6e5ead5c450d679aefdbb1d3:/doc/bugs/map_fails_to_close_ul_element_for_empty_list.mdwn
diff --git a/doc/bugs/map_fails_to_close_ul_element_for_empty_list.mdwn b/doc/bugs/map_fails_to_close_ul_element_for_empty_list.mdwn
index c786c5f68..0edba438c 100644
--- a/doc/bugs/map_fails_to_close_ul_element_for_empty_list.mdwn
+++ b/doc/bugs/map_fails_to_close_ul_element_for_empty_list.mdwn
@@ -6,11 +6,42 @@ input:
Presuming that the pagespec does not match, output:
- <p>before.
- <div class="map">
- <ul>
- </div></p>
+
before.
+
The UL element is not closed.
+Patch[[!tag patch]]:
+
+ --- /usr/share/perl5/IkiWiki/Plugin/map.pm 2009-05-06 00:56:55.000000000 +0100
+ +++ IkiWiki/Plugin/map.pm 2009-06-15 12:23:54.000000000 +0100
+ @@ -137,11 +137,11 @@
+ $openli=1;
+ $parent=$item;
+ }
+ - while ($indent > 0) {
+ + while ($indent > 1) {
+ $indent--;
+ $map .= "\n\n";
+ }
+ - $map .= "\n";
+ + $map .= "\n\n";
+ return $map;
+ }
+
+
-- [[Jon]]
+
+> Strictly speaking, a `` with no `- `s isn't valid HTML either...
+> could `map` instead delay emitting the first `
` until it determines that
+> it will have at least one item? Perhaps refactoring that function into
+> something easier to regression-test would be useful. --[[smcv]]
+
+>> You are right (just checked 4.01 DTD to confirm). I suspect refactoring
+>> the function would be wise. From my brief look at it to formulate the
+>> above I thought it was a bit icky. I'm not a good judge of what would
+>> be regression-test friendly but I might have a go at reworking it. With
+>> this variety of problem I have a strong inclination to use HOFs like map,
+>> grep. - [[Jon]]