]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/aggregate.pm
comments: instead of hard-coding mdwn, allow any supported page format
[git.ikiwiki.info.git] / IkiWiki / Plugin / aggregate.pm
index f256b3ac1a9a58a10324ee6e1eb3523cecf4da7c..adaa619ab1a255d5904c71bc100c52c2fb10b414 100644 (file)
@@ -535,7 +535,7 @@ sub aggregate (@) { #{{{
                                copyright => $f->copyright,
                                title => defined $entry->title ? decode_entities($entry->title) : "untitled",
                                link => $entry->link,
-                               content => defined $c ? $c->body : "",
+                               content => (defined $c && defined $c->body) ? $c->body : "",
                                guid => defined $entry->id ? $entry->id : time."_".$feed->{name},
                                ctime => $entry->issued ? ($entry->issued->epoch || time) : time,
                                base => (defined $c && $c->can("base")) ? $c->base : undef,
@@ -610,7 +610,7 @@ sub add_page (@) { #{{{
        my $template=template($feed->{template}, blind_cache => 1);
        $template->param(title => $params{title})
                if defined $params{title} && length($params{title});
-       $template->param(content => htmlescape(htmlabs($params{content},
+       $template->param(content => wikiescape(htmlabs($params{content},
                defined $params{base} ? $params{base} : $feed->{feedurl})));
        $template->param(name => $feed->{name});
        $template->param(url => $feed->{url});
@@ -637,11 +637,9 @@ sub add_page (@) { #{{{
        }
 } #}}}
 
-sub htmlescape ($) { #{{{
+sub wikiescape ($) { #{{{
        # escape accidental wikilinks and preprocessor stuff
-       my $html=shift;
-       $html=~s/(?<!\\)\[\[/\\\[\[/g;
-       return $html;
+       return encode_entities(shift, '\[\]');
 } #}}}
 
 sub urlabs ($$) { #{{{