It looks like you just want second idx:orth tag to have the non-special character value and no additional attributes. Therefore just output the tag explicitly instead of taking the previous text and modifying it since that will contain the potential additional attributes.
sub fix_umlaut { my ( $tagname, $attr, $text ) = @_; $output .= $text; if ( $tagname eq 'idx:orth' && $attr->{value} =~ s/([$um])/$replac +e{$1}/g ) { $output .= qq{<idx:orth value="$attr->{value}"/>}; # repeat t +he tag with modified umlauts } }
In reply to Re: Limit substitution in html parsing
by wind
in thread Limit substitution in html parsing
by pcerda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |