Subject: | Locale::Maketext::Utils::Phrase functions |
1. escape bracket notation (e.g. for PBI 2951)
2. hack away markup characters
+ # swap markup for BN (or if inside BN an embeddable option?)
+ my $struct = Locale::Maketext::Utils::Phrase::phrase2struct($translated);
+ $translated = '';
+ for my $piece ( @{$struct} ) {
+ if ( !ref($piece) ) {
+ $piece =~ s/'/[output,apos]/g;
+ $piece =~ s/"/[output,quot]/g;
+ $piece =~ s/</[output,lt]/g;
+ $piece =~ s/>/[output,gt]/g;
+ $piece =~ s/&/[output,amp]/g;
+ }
+ else {
+
+ # in the event the method supports embedded methods great, in the event it
doesn't at least it won't have markup
+ $piece->{'cont'} =~ s/'/chr\(39\)/g;
+ $piece->{'cont'} =~ s/"/chr\(34\)/g;
+ $piece->{'cont'} =~ s/</chr\(60\)/g;
+ $piece->{'cont'} =~ s/>/chr\(62\)/g;
+ $piece->{'cont'} =~ s/&/chr\(38\)/g;
+
+ $translated .= "[$piece->{'cont'}]";
+ }
+ }