X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/6c08f60465c441baff92074c3122fcb62457658c..0e8416907674da88819b70d6db208fa490d0f946:/Shiar_Sheet/FormatChar.pm
diff --git a/Shiar_Sheet/FormatChar.pm b/Shiar_Sheet/FormatChar.pm
index 62f6791..78f2a19 100644
--- a/Shiar_Sheet/FormatChar.pm
+++ b/Shiar_Sheet/FormatChar.pm
@@ -108,38 +108,40 @@ sub cell {
}
my $anno = '';
- for (@{ $self->{anno} }) {
- if (/html$/) {
- require HTML::Entities;
- if (my $entity = $HTML::Entities::char2entity{$cell}) {
- $entity = substr($entity, 1, -1) unless /^&/;
- $anno = sprintf(' %s', EscapeHTML($entity));
- last;
+ if ($cell ne '') {
+ for (@{ $self->{anno} }) {
+ if (/html$/) {
+ require HTML::Entities;
+ if (my $entity = $HTML::Entities::char2entity{$cell}) {
+ $entity = substr($entity, 1, -1) unless /^&/;
+ $anno = sprintf(' %s', EscapeHTML($entity));
+ last;
+ }
}
- }
- elsif ($_ eq 'xml') {
- $anno = sprintf(' %s',
- sprintf '#%d', ord($cell)
- );
- last;
- }
- elsif ($_ eq '&xml') {
- $anno = sprintf(' %s',
- sprintf '&#%d;', ord($cell)
- );
- last;
- }
- elsif ($_ eq 'di') {
- if (defined $mnem and length $mnem) {
- $anno = sprintf(' %s', EscapeHTML($mnem));
+ elsif ($_ eq 'xml') {
+ $anno = sprintf(' %s',
+ sprintf '#%d', ord($cell)
+ );
last;
}
- }
- else {
- if ($_ eq 'hex' or $cell =~ /^[^a-zA-Z]$/) {
- $anno = sprintf(' %04X', 'value', ord $cell);
+ elsif ($_ eq '&xml') {
+ $anno = sprintf(' %s',
+ sprintf '&#%d;', ord($cell)
+ );
last;
}
+ elsif ($_ eq 'di') {
+ if (defined $mnem and length $mnem) {
+ $anno = sprintf(' %s', EscapeHTML($mnem));
+ last;
+ }
+ }
+ else {
+ if ($_ eq 'hex' or $cell =~ /^[^a-zA-Z]$/) {
+ $anno = sprintf(' %04X', 'value', ord $cell);
+ last;
+ }
+ }
}
}