From 3525a6b7f23421779091daad7a1e19b02d7db141 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 28 Sep 2009 16:21:03 -0400 Subject: [PATCH] toggle, relativedate: Support templates that add attributes to the body tag. --- IkiWiki/Plugin/relativedate.pm | 2 +- IkiWiki/Plugin/toggle.pm | 2 +- debian/changelog | 2 ++ doc/bugs/toggle_expects_body_element_without_attributes.mdwn | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm index 3e33cd5c3..06df2efd5 100644 --- a/IkiWiki/Plugin/relativedate.pm +++ b/IkiWiki/Plugin/relativedate.pm @@ -26,7 +26,7 @@ sub getsetup () { sub format (@) { my %params=@_; - if (! ($params{content}=~s!^()!$1.include_javascript($params{page})!em)) { + if (! ($params{content}=~s!^(]*>)!$1.include_javascript($params{page})!em)) { # no tag, probably in preview mode $params{content}=include_javascript($params{page}, 1).$params{content}; } diff --git a/IkiWiki/Plugin/toggle.pm b/IkiWiki/Plugin/toggle.pm index aae8cdf84..ef066a42f 100644 --- a/IkiWiki/Plugin/toggle.pm +++ b/IkiWiki/Plugin/toggle.pm @@ -68,7 +68,7 @@ sub format (@) { if ($params{content}=~s!(
\s*)
!$1!g) { $params{content}=~s/
//g; - if (! ($params{content}=~s!^()!$1.include_javascript($params{page})!em)) { + if (! ($params{content}=~s!^(]*>)!$1.include_javascript($params{page})!em)) { # no tag, probably in preview mode $params{content}=include_javascript($params{page}, 1).$params{content}; } diff --git a/debian/changelog b/debian/changelog index 44c810b00..b368618b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Sun, 27 Sep 2009 17:40:03 -0400 diff --git a/doc/bugs/toggle_expects_body_element_without_attributes.mdwn b/doc/bugs/toggle_expects_body_element_without_attributes.mdwn index 6cb03e934..0b39346f4 100644 --- a/doc/bugs/toggle_expects_body_element_without_attributes.mdwn +++ b/doc/bugs/toggle_expects_body_element_without_attributes.mdwn @@ -1 +1,3 @@ The toggle plugins checks for a `` in the page; if not found, javascript tags are inserted at the top of the document. Since my page uses ``; a plain `` 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]] -- 2.32.0.93.g670b81a890