escape angle brackets

The script doesn't escape angle brackets which can result in bad SGML / XML output. This fixes that, although ideally, this should be implemented with a proper parser and dumper.
This commit is contained in:
Matt Post 2019-04-26 14:24:07 -04:00 committed by GitHub
parent 187a75cb55
commit 63c450b401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,8 @@ while(<SRC>) {
elsif (/<seg/) {
my $line = shift(@OUT);
$line = "" if $line =~ /NO BEST TRANSLATION/;
$line =~ s/</&lt;/g;
$line =~ s/>/&gt;/g;
if (/<\/seg>/) {
s/(<seg[^>]+> *).*(<\/seg>)/$1$line$2/i;
$missing_end_seg = 0;