X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/8c31a01efa05c4fb821e1364b8792b89852619a3..84156d17425fd5902694b377c60861f8247b8694:/IkiWiki/Plugin/teximg.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/teximg.pm b/IkiWiki/Plugin/teximg.pm index 1993249eb..5dff5feef 100644 --- a/IkiWiki/Plugin/teximg.pm +++ b/IkiWiki/Plugin/teximg.pm @@ -7,7 +7,7 @@ use warnings; use strict; use Digest::MD5 qw(md5_hex); use File::Temp qw(tempdir); -use URI::Escape qw(uri_escape); +use HTML::Entities; use IkiWiki 2.00; sub import { #{{{ @@ -70,9 +70,8 @@ sub create ($$$) { #{{{ my $digest = md5_hex($code, $height); - my $teximgdir = "/teximag"; - my $imglink = "$teximgdir/$digest.png"; - my $imglog = "$teximgdir/$digest.log"; + my $imglink= $params->{page} . "/$digest.png"; + my $imglog = $params->{page} . "/$digest.log"; will_render($params->{destpage}, $imglink); will_render($params->{destpage}, $imglog); @@ -83,14 +82,14 @@ sub create ($$$) { #{{{ $logurl = urlto($imglog, $params->{destpage}); } else { - $imgurl="$config{url}/$teximgdir/$digest.png"; - $logurl="$config{url}/$teximgdir/$digest.log"; + $imgurl=$params->{page}."/$digest.png"; + $logurl=$params->{page}."/$digest.log"; } if (-e "$config{destdir}/$imglink" || - gen_image($code, $height, $digest, $teximgdir)) { + gen_image($code, $height, $digest, $params->{page})) { return qq{}
-			.(exists $params{alt} ? $params{alt} : uri_escape($code))
+			.(exists $params->{alt} ? $params->{alt} : encode_entities($code))
 			.qq{}; } else {