--- loncom/interface/entities.pm 2008/04/29 10:15:58 1.10 +++ loncom/interface/entities.pm 2008/10/10 10:16:53 1.12 @@ -932,7 +932,8 @@ my %entities = ( my %utf_table = ( 'THORN' => 222, 'thorn' => 254, - 'eth' => 240 + 'eth' => 240, + 'hearts' => 9829 ); # @@ -978,6 +979,7 @@ sub entity_to_latex { # Try to look up the entity (text or numeric) in the hash: + my $latex = $entities{"$entity"}; if (defined $latex) { return $latex; @@ -1030,6 +1032,18 @@ sub replace_entities { $latex = &entity_to_latex($entity); substr($input, $start, $end-$start) = $latex; } + + # Hexadecimal entities: + + while ($input =~ /&\#x(\d|[a-f,A-f])+;/) { + ($start) = @-; + ($end) = @+; + $entity = "0" . substr($input, $start+2, $end-$start-3); # 0xhexnumber + $latex = &entity_to_latex(hex($entity)); + substr($input, $start, $end-$start) = $latex; + } + + # Now the &text; entites; while ($input =~/(&\w+;)/) {