]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/toggle.pm
beautify url recentchanges_link redirs to
[ikiwiki.git] / IkiWiki / Plugin / toggle.pm
index f969d7686709da5a06410a260c09fbc598530f4b..284eb8249df031e77f2e1ff1796d19624bbae1cf 100644 (file)
@@ -108,9 +108,9 @@ sub format (@) { #{{{
 
        if ($params{content}=~s!(<div class="toggleable(?:-open)?" id="[^"]+">)</div>!$1!g) {
                $params{content}=~s/<div class="toggleableend">//g;
-               if (! ($params{content}=~s!^<\/body>!$javascript</body>!m)) {
+               if (! ($params{content}=~s!^<body>!<body>$javascript!m)) {
                        # no </body> tag, probably in preview mode
-                       $params{content}.=$javascript;
+                       $params{content}=$javascript.$params{content};
                }
        }
        return $params{content};