]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Render.pm
web commit by http://id.loopysoft.com/matt/
[git.ikiwiki.info.git] / IkiWiki / Render.pm
index 2682e13ae5b6e76ac67df22c59319dba07fac51a..782818cdf49a92917bd4e6762319746841da6d5f 100644 (file)
@@ -165,18 +165,23 @@ sub scan ($) { #{{{
                # Always needs to be done, since filters might add links
                # to the content.
                $content=filter($page, $page, $content);
-
-               my @links;
-               while ($content =~ /(?<!\\)$config{wiki_link_regexp}/g) {
-                       push @links, linkpage($2);
-               }
+       
                if ($config{discussion}) {
                        # Discussion links are a special case since they're
                        # not in the text of the page, but on its template.
-                       push @links, $page."/".gettext("discussion");
+                       $links{$page}=[ $page."/".gettext("discussion") ];
                }
-               $links{$page}=\@links;
-               
+               else {
+                       $links{$page}=[];
+               }
+
+               run_hooks(scan => sub {
+                       shift->(
+                               page => $page,
+                               content => $content,
+                       );
+               });
+
                # Preprocess in scan-only mode.
                preprocess($page, $page, $content, 1);
        }