summaryrefslogtreecommitdiff
path: root/IkiWiki/Render.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-02-11 22:48:27 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-02-11 22:48:27 -0500
commit4763514861457c295cadb7dbc7c0697ce682004f (patch)
tree159272cf44815ca8ffa24a363c24d2a5b384c94b /IkiWiki/Render.pm
parent5163646e264633480d8562f2419bdaca597148c1 (diff)
* Add the linkify and scan hooks. These hooks can be used to implement
custom, first-class types of wikilinks. * Move standard wikilink implementation to a new wikilink plugin, which will of course be enabled by default.
Diffstat (limited to 'IkiWiki/Render.pm')
-rw-r--r--IkiWiki/Render.pm21
1 files changed, 13 insertions, 8 deletions
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index 2682e13ae..782818cdf 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -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);
}