From e0d14956e6b4179eaa2f58b5b6398eb51d5c79f8 Mon Sep 17 00:00:00 2001 From: imiyazaki Date: Wed, 22 Oct 2003 17:00:25 +0000 Subject: [PATCH] add $prefix and $suffix to entity reference in &de_er. --- Chise_utils/Chise_utils.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Chise_utils/Chise_utils.pm b/Chise_utils/Chise_utils.pm index 1c2aca0..2f40e75 100644 --- a/Chise_utils/Chise_utils.pm +++ b/Chise_utils/Chise_utils.pm @@ -234,8 +234,11 @@ sub get_chars_for{ sub de_er{ my($er)=@_; my($output_char,$atr,$value); + my($prefix,$suffix); + $er=~/^(amp|&)?(.+?)(;)?$/ + and $prefix=$1,$er=$2,$suffix=$3; + $prefix or $prefix="",$suffix or $suffix=""; if($er=~/^\d+$/){ - # only for debug. $output_char=pack("U",$er); }elsif($er=~/^U[\+\-]([a-fA-F\d]+)/){ $output_char=pack("U",hex($1)); @@ -247,9 +250,9 @@ sub de_er{ ($output_char)=&get_chars_matching($er_alias{$atr},$value); } if($output_char){ - return $output_char; + return $output_char; }else{ - return $er; + return $prefix.$er.$suffix; } } -- 1.7.10.4