]> sipb.mit.edu Git - ikiwiki.git/commitdiff
inline: The optimisation in 2.41 broke nested inlines. Detect those and avoid overopt...
authorJoey Hess <joey@kodama.kitenet.net>
Sat, 31 May 2008 19:10:23 +0000 (15:10 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sat, 31 May 2008 19:10:23 +0000 (15:10 -0400)
IkiWiki/Plugin/inline.pm
debian/changelog
doc/bugs/nested_inlines_produce_no_output.mdwn

index 1fbd8b69c98ba05c0a3cca3b8d2c0331870ed292..7d81e918271809c3d6acd5ded979b1255233cc09 100644 (file)
@@ -11,6 +11,7 @@ use URI;
 my %knownfeeds;
 my %page_numfeeds;
 my @inline;
+my $nested=0;
 
 sub import { #{{{
        hook(type => "getopt", id => "inline", call => \&getopt);
@@ -329,7 +330,7 @@ sub preprocess_inline (@) { #{{{
                }
        }
        
-       return $ret if $raw;
+       return $ret if $raw || $nested;
        push @inline, $ret;
        return "<div class=\"inline\" id=\"$#inline\"></div>\n\n";
 } #}}}
@@ -350,11 +351,14 @@ sub get_inline_content ($$) { #{{{
        my $file=$pagesources{$page};
        my $type=pagetype($file);
        if (defined $type) {
-               return htmlize($page, $type,
+               $nested++;
+               my $ret=htmlize($page, $type,
                       linkify($page, $destpage,
                       preprocess($page, $destpage,
                       filter($page, $destpage,
                       readfile(srcfile($file))))));
+               $nested--;
+               return $ret;
        }
        else {
                return "";
index 1f24f75308e91e9eabc10f14f71217fd7555cf74..7a3f6061f09e7ab02956cf4bc8dbb40144405949 100644 (file)
@@ -2,6 +2,8 @@ ikiwiki (2.49) UNRELEASED; urgency=low
 
   * haiku: Generate valid xhtml.
   * ikiwiki-mass-rebuild: Don't trust $! when setting $)
+  * inline: The optimisation in 2.41 broke nested inlines. Detect those
+    and avoid overoptimising.
 
  -- Joey Hess <joeyh@debian.org>  Fri, 30 May 2008 19:08:54 -0400
 
index c40a847b00afc8bf602e35fa2c40129af11c4abd..3f2fccdfb12286eac8dffc3403c684c25e1c45b1 100644 (file)
@@ -8,3 +8,5 @@ If an inlined page itself contains an inline directive, the nested directive wil
 When rendered, _pets_ [contains](http://www.willthompson.co.uk/tmp/ikiwiki-nested-inline/output/pets/) the content from _pets/dogs_ and _pets/cats_, but not the pages inlined into them.  However, the subpages [correctly](http://www.willthompson.co.uk/tmp/ikiwiki-nested-inline/output/pets/dogs/) [include](http://www.willthompson.co.uk/tmp/ikiwiki-nested-inline/output/pets/cats/) their own children.
 
 This used to work in at least ikiwiki 1.45.  I stepped through `preprocess_inline`, but couldn't see why this wasn't working.
+
+> Broke due to overoptimisation, fixed now. [[done]] --[[Joey]]