]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/toggle.pm
* Fix some issues with toggles in preview mode.
[ikiwiki.git] / IkiWiki / Plugin / toggle.pm
index 3f9c4867256ab0f9aa9f23bd1026f9594ee27a39..df5a2a7373290026a11910b97b94a291f24eed5c 100644 (file)
@@ -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 (@) { #{{{