summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-02-14 00:11:19 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-02-14 00:11:19 +0000
commit6fc66f83deba6df8abdf4bc117f8da7efbd7cbc1 (patch)
treeb65261ec25063bea8fd8e8b4793917fea65768de /IkiWiki/Plugin
parent433832b020c6464938992293c15cc8cdcfbd18f7 (diff)
* Fix the template, toggle, and conditional plugins to filter text before
preprocessing it. * Fix smiley plugin to support smileys at the very beginning or end of the content.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/conditional.pm3
-rw-r--r--IkiWiki/Plugin/smiley.pm4
-rw-r--r--IkiWiki/Plugin/template.pm3
-rw-r--r--IkiWiki/Plugin/toggle.pm3
4 files changed, 8 insertions, 5 deletions
diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm
index 35418a3ba..293fbc191 100644
--- a/IkiWiki/Plugin/conditional.pm
+++ b/IkiWiki/Plugin/conditional.pm
@@ -53,7 +53,8 @@ sub preprocess_if (@) { #{{{
else {
$ret="";
}
- return IkiWiki::preprocess($params{page}, $params{destpage}, $ret);
+ return IkiWiki::preprocess($params{page}, $params{destpage},
+ IkiWiki::filter($params{page}, $ret));
} # }}}
package IkiWiki::PageSpec;
diff --git a/IkiWiki/Plugin/smiley.pm b/IkiWiki/Plugin/smiley.pm
index 85a719337..45d00abea 100644
--- a/IkiWiki/Plugin/smiley.pm
+++ b/IkiWiki/Plugin/smiley.pm
@@ -34,10 +34,10 @@ sub setup () { #{{{
sub filter (@) { #{{{
my %params=@_;
- $params{content} =~ s{(?<=\s)(\\?)$smiley_regexp(?=\s)}{
+ $params{content} =~ s{(?:^|(?<=\s))(\\?)$smiley_regexp(?:(?=\s)|$)}{
$1 ? $2 : htmllink($params{page}, $params{page}, $smileys{$2}, 0, 0, $2)
}egs;
-
+
return $params{content};
} # }}}
diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm
index 23d9d65d8..16a3c1e37 100644
--- a/IkiWiki/Plugin/template.pm
+++ b/IkiWiki/Plugin/template.pm
@@ -50,7 +50,8 @@ sub preprocess (@) { #{{{
}
return IkiWiki::preprocess($params{page}, $params{destpage},
- $template->output);
+ IkiWiki::filter($params{page},
+ $template->output));
} # }}}
1
diff --git a/IkiWiki/Plugin/toggle.pm b/IkiWiki/Plugin/toggle.pm
index c68e30892..7318731c5 100644
--- a/IkiWiki/Plugin/toggle.pm
+++ b/IkiWiki/Plugin/toggle.pm
@@ -88,7 +88,8 @@ sub preprocess_toggleable (@) { #{{{
# Preprocess the text to expand any preprocessor directives
# embedded inside it.
- $params{text}=IkiWiki::preprocess($params{page}, $params{destpage}, $params{text});
+ $params{text}=IkiWiki::preprocess($params{page}, $params{destpage},
+ IkiWiki::filter($params{page}, $params{text}));
my $id=genid($params{page}, $params{id});