in reply to Limit substitution in html parsing
UPDATE: Instead of using $text you might construct the tag yourself:
sub fix_umlaut { my ( $tagname, $attr, $text ) = @_; $output .= $text; if ( $tagname eq 'idx:orth' and $$attr{value} =~ s/[$um]/$replace{ +$1}/g ) { delete $$attr{'infl'}; $output .= '<idx:orth ' . map( " $_=\"".$$attr{$_}.'"',keys(%$ +attr)) . '/>'; # repeat the tag with modified umlauts } }
|
|---|