X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/9cabbcb99510ce7c9256d085d1c9de6c0b5fc8ce..96bfc3addc80d99f3b329cbb9ed9674c6f6c89b2:/Shiar_Sheet/FormatChar.pm diff --git a/Shiar_Sheet/FormatChar.pm b/Shiar_Sheet/FormatChar.pm index 647280e..707fdc6 100644 --- a/Shiar_Sheet/FormatChar.pm +++ b/Shiar_Sheet/FormatChar.pm @@ -109,7 +109,21 @@ sub cell { my $anno = ''; for (@{ $self->{anno} }) { - if ($_ eq 'di') { + if ($_ eq 'html') { + require HTML::Entities; + if (my $_ = $HTML::Entities::char2entity{$cell}) { + $anno = sprintf(' %s', EscapeHTML($_)); + last; + } + } + elsif ($_ eq 'xml') { + require HTML::Entities; + $anno = sprintf(' %s', + sprintf "&#%d;", ord($cell) + ); + last; + } + elsif ($_ eq 'di') { if (defined $mnem and length $mnem) { $anno = sprintf(' %s', EscapeHTML($mnem)); last;