diff options
author | Joey Hess <joey@kitenet.net> | 2007-11-27 16:36:37 -0500 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2007-11-27 16:36:37 -0500 |
commit | c3805557f183a9ad628b58a06e64269a4982f6d6 (patch) | |
tree | bf969ffc432acfb40dd187f18aae3edb66755ca3 /IkiWiki/Plugin | |
parent | ce70d375a451eb11f257e310f834972d2e432e82 (diff) | |
download | ikiwiki-c3805557f183a9ad628b58a06e64269a4982f6d6.tar ikiwiki-c3805557f183a9ad628b58a06e64269a4982f6d6.tar.gz |
* 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')
-rw-r--r-- | IkiWiki/Plugin/mdwn.pm | 8 |
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; |