my %knownfeeds;
my %page_numfeeds;
+my @inline;
sub import { #{{{
hook(type => "getopt", id => "inline", call => \&getopt);
call => \&IkiWiki::preprocess_inline);
hook(type => "pagetemplate", id => "inline",
call => \&IkiWiki::pagetemplate_inline);
+ hook(type => "format", id => "inline", call => \&format);
# Hook to change to do pinging since it's called late.
# This ensures each page only pings once and prevents slow
# pings interrupting page builds.
}
} #}}}
+sub format (@) { #{{{
+ my %params=@_;
+
+ # Fill in the inline content generated earlier. This is actually an
+ # optimisation.
+ $params{content}=~s!<div class="inline" id="([^"]+)"></div>!$inline[$1]!g;
+ return $params{content};
+} #}}}
+
sub sessioncgi () { #{{{
my $q=shift;
my $session=shift;
}
}
- return $ret;
+ return $ret if $raw;
+ push @inline, $ret;
+ return "<div class=\"inline\" id=\"$#inline\"></div>\n\n";
} #}}}
sub pagetemplate_inline (@) { #{{{
(Old files will be automatically converted.)
* Close meta tag for redir properly.
* smiley: Detect smileys inside pre and code tags, and do not expand.
+ * inline: Crazy optimisation to work around slow markdown.
-- martin f. krafft <madduck@debian.org> Sun, 02 Mar 2008 17:46:38 +0100