]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/shortcut.pm
inline: The optimisation in 2.41 broke nested inlines. Detect those and avoid overopt...
[ikiwiki.git] / IkiWiki / Plugin / shortcut.pm
index 0e7769c67c7f22f36b9b1e857660cc9b8ba0ad9c..f1a38ea48070ed255ea8046e8b4d5c1dd6787af3 100644 (file)
@@ -13,8 +13,11 @@ sub import { #{{{
 sub checkconfig () { #{{{
        # Preprocess the shortcuts page to get all the available shortcuts
        # defined before other pages are rendered.
-       IkiWiki::preprocess("shortcuts", "shortcuts",
-               readfile(srcfile("shortcuts.mdwn")));
+       my $srcfile=srcfile("shortcuts.mdwn", 1);
+       if (! defined $srcfile) {
+               error(gettext("shortcut plugin will not work without a shortcuts.mdwn"));
+       }
+       IkiWiki::preprocess("shortcuts", "shortcuts", readfile($srcfile));
 } # }}}
 
 sub preprocess_shortcut (@) { #{{{
@@ -59,6 +62,9 @@ sub shortcut_expand ($$@) { #{{{
        }eg;
 
        $text=~s/_/ /g;
+       if (defined $params{desc}) {
+               $desc=$params{desc};
+       }
        if (defined $desc) {
                $desc=~s/\%s/$text/g;
        }