Handle the case when HTML got tidied.
authorEnrico Zini <enrico@enricozini.org>
Sat, 26 Jul 2008 22:05:22 +0000 (23:05 +0100)
committerJoey Hess <joey@kodama.kitenet.net>
Sun, 27 Jul 2008 03:05:57 +0000 (23:05 -0400)
This fixes debian bug #492529.

IkiWiki/Plugin/toggle.pm

index cd9617e259d5433f561faabb4719abc7756c8d75..e203defb09f602f462ceac269d6742651691802c 100644 (file)
@@ -110,7 +110,7 @@ sub preprocess_toggleable (@) { #{{{
 sub format (@) { #{{{
         my %params=@_;
 
-       if ($params{content}=~s!(<div class="toggleable(?:-open)?" id="[^"]+">)</div>!$1!g) {
+       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>!<body>$javascript!m)) {
                        # no </body> tag, probably in preview mode