toggle, relativedate: Support templates that add attributes to the body tag.
authorJoey Hess <joey@gnu.kitenet.net>
Mon, 28 Sep 2009 20:21:03 +0000 (16:21 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Mon, 28 Sep 2009 20:21:03 +0000 (16:21 -0400)
IkiWiki/Plugin/relativedate.pm
IkiWiki/Plugin/toggle.pm
debian/changelog
doc/bugs/toggle_expects_body_element_without_attributes.mdwn

index 3e33cd5c358d42c56348bbaafa64daea6d8bb2c7..06df2efd58cba5697a20f99be8730bd61a06e702 100644 (file)
@@ -26,7 +26,7 @@ sub getsetup () {
 sub format (@) {
         my %params=@_;
 
-       if (! ($params{content}=~s!^(<body>)!$1.include_javascript($params{page})!em)) {
+       if (! ($params{content}=~s!^(<body[^>]*>)!$1.include_javascript($params{page})!em)) {
                # no </body> tag, probably in preview mode
                $params{content}=include_javascript($params{page}, 1).$params{content};
        }
index aae8cdf84beeff62d54197db0e5f1e2733fe5810..ef066a42ff198212903474c6bc82f1140c879ba9 100644 (file)
@@ -68,7 +68,7 @@ sub format (@) {
 
        if ($params{content}=~s!(<div class="toggleable(?:-open)?" id="[^"]+">\s*)</div>!$1!g) {
                $params{content}=~s/<div class="toggleableend">//g;
-               if (! ($params{content}=~s!^(<body>)!$1.include_javascript($params{page})!em)) {
+               if (! ($params{content}=~s!^(<body[^>]*>)!$1.include_javascript($params{page})!em)) {
                        # no </body> tag, probably in preview mode
                        $params{content}=include_javascript($params{page}, 1).$params{content};
                }
index 44c810b00f8817ba11d1a5582cc1f30f7808650d..b368618b430ea96d373f86ae1b12dea9e2a6cf2e 100644 (file)
@@ -4,6 +4,8 @@ ikiwiki (3.14159266) UNRELEASED; urgency=low
     the toplevel index differently etc.
   * img: Correct bug in image size calculation code.
   * img: Fix dependency code for full size images.
+  * toggle, relativedate: Support templates that add attributes
+    to the body tag.
 
  -- Joey Hess <joeyh@debian.org>  Sun, 27 Sep 2009 17:40:03 -0400
 
index 6cb03e934da7bbc7bd3deaa5d068b7aef6c15ea1..0b39346f4c65ebe17782558acadbc00b7baaebf9 100644 (file)
@@ -1 +1,3 @@
 The toggle plugins checks for a `<body>` in the page; if not found, javascript tags are inserted at the top of the document. Since my page uses `<body onload="javascript:fixLinks()">`; a plain `<body>` is not found and I get script links before the docstring declaration. Please see the source of the following toggle-using page: http://kaizer.se/wiki/kupfer/ -- ulrik [kaizer.se]
+
+[[fixed|done]] --[[Joey]]