X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/29db15d31cff5e8b59020ad908ea4985e62ff22e..d8deff0a0c8fcb10784d06535d313e3cf880f799:/IkiWiki/Plugin/teximg.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/teximg.pm b/IkiWiki/Plugin/teximg.pm index f92ed0132..3d6fa9942 100644 --- a/IkiWiki/Plugin/teximg.pm +++ b/IkiWiki/Plugin/teximg.pm @@ -8,10 +8,12 @@ use strict; use Digest::MD5 qw(md5_hex); use File::Temp qw(tempdir); use HTML::Entities; +use Encode; use IkiWiki 3.00; my $default_prefix = < { safe => 1, rebuild => undef, + section => "widget", }, teximg_dvipng => { type => "boolean", @@ -102,7 +105,7 @@ sub create ($$$) { $height = 12; } - my $digest = md5_hex($code, $height); + my $digest = md5_hex(Encode::encode_utf8($code), $height); my $imglink= $params->{page} . "/$digest.png"; my $imglog = $params->{page} . "/$digest.log"; @@ -141,7 +144,7 @@ sub gen_image ($$$$) { } my $tex = $config{teximg_prefix}; - $tex .= '$$'.$code.'$$'; + $tex .= '\['.$code.'\]'; $tex .= $config{teximg_postfix}; $tex =~ s!\\documentclass{article}!\\documentclass[${height}pt]{article}!g; $tex =~ s!\\documentclass{scrartcl}!\\documentclass[${height}pt]{scrartcl}!g;