summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/mdwn.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2007-11-27 16:36:37 -0500
committerJoey Hess <joey@kitenet.net>2007-11-27 16:36:37 -0500
commitc3805557f183a9ad628b58a06e64269a4982f6d6 (patch)
treebf969ffc432acfb40dd187f18aae3edb66755ca3 /IkiWiki/Plugin/mdwn.pm
parentce70d375a451eb11f257e310f834972d2e432e82 (diff)
* Improve workaround for perl bug #376329. Rather than double-encoding,
which has been reported to cause encoding problems (though I haven't reproduced them), just catch a failure of markdown, and retry. (The crazy perl bug magically disappears on the retry.) Closes: #449379
Diffstat (limited to 'IkiWiki/Plugin/mdwn.pm')
-rw-r--r--IkiWiki/Plugin/mdwn.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm
index ca8898679..254ab51d0 100644
--- a/IkiWiki/Plugin/mdwn.pm
+++ b/IkiWiki/Plugin/mdwn.pm
@@ -43,9 +43,11 @@ sub htmlize (@) { #{{{
# Workaround for perl bug (#376329)
$content=Encode::encode_utf8($content);
- $content=Encode::encode_utf8($content);
- $content=&$markdown_sub($content);
- $content=Encode::decode_utf8($content);
+ eval {$content=&$markdown_sub($content)};
+ if ($@) {
+ eval {$content=&$markdown_sub($content)};
+ print STDERR $@ if $@;
+ }
$content=Encode::decode_utf8($content);
return $content;