aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/toggle.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2007-10-29 17:16:10 -0400
committerJoey Hess <joey@kodama.kitenet.net>2007-10-29 17:16:10 -0400
commit683c1ebb4c510eac5bb2c2b4e85c3f7b5ded3146 (patch)
tree996adc2aaa9adc15ee0e7a6b7e68df2450599dd9 /IkiWiki/Plugin/toggle.pm
parent67acb0463b327156cfc6e0e3450eb87604d854bd (diff)
downloadikiwiki-683c1ebb4c510eac5bb2c2b4e85c3f7b5ded3146.tar
ikiwiki-683c1ebb4c510eac5bb2c2b4e85c3f7b5ded3146.tar.gz
* Fix some issues with toggles in preview mode.
Diffstat (limited to 'IkiWiki/Plugin/toggle.pm')
-rw-r--r--IkiWiki/Plugin/toggle.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/toggle.pm b/IkiWiki/Plugin/toggle.pm
index 3f9c48672..df5a2a737 100644
--- a/IkiWiki/Plugin/toggle.pm
+++ b/IkiWiki/Plugin/toggle.pm
@@ -80,7 +80,13 @@ sub preprocess_toggle (@) { #{{{
my %params=(id => "default", text => "more", @_);
my $id=genid($params{page}, $params{id});
- return "<a class=\"toggle\" href=\"#$id\">$params{text}</a>";
+ if (! $params{preview}) {
+ return "<a class=\"toggle\" href=\"#$id\">$params{text}</a>";
+ }
+ else {
+ return "$params{text} ".
+ gettext("(not toggleable in preview mode)");
+ }
} # }}}
sub preprocess_toggleable (@) { #{{{