]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Render.pm
web commit by http://satori.no-ip.org/vs/
[ikiwiki.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);
        }