mirror of https://github.com/tLDP/LDP
48 lines
841 B
Perl
48 lines
841 B
Perl
|
#!/usr/bin/perl
|
||
|
#
|
||
|
# $Id$
|
||
|
#
|
||
|
# SGML LyX qoute entinity fix tool
|
||
|
#
|
||
|
# (P) & (C) 2002 by Peter Bieringer <pb@bieringer.de>
|
||
|
#
|
||
|
# Published under the GNU GPL licence
|
||
|
#
|
||
|
# Takes SGML output exported by LyX and fix a bug regarding quote entinities
|
||
|
# Don't know the reason what causes this, but it is wrong.
|
||
|
#
|
||
|
# Replaces:
|
||
|
# “ -> "
|
||
|
# ” -> "
|
||
|
#
|
||
|
# Changes:
|
||
|
# 20020125: Initial release
|
||
|
#
|
||
|
# Known bugs:
|
||
|
# Entinity must be in one line
|
||
|
|
||
|
print STDERR "INF : Replacing special quotes entinities\n";
|
||
|
|
||
|
while (<STDIN>) {
|
||
|
my $line = $_;
|
||
|
chomp $line;
|
||
|
|
||
|
#print "$line";
|
||
|
#print "\n";
|
||
|
|
||
|
if ($line =~ /“/) {
|
||
|
print STDERR "<";
|
||
|
# Substitute
|
||
|
$line =~ s/“/"/g;
|
||
|
};
|
||
|
if ($line =~ /”/) {
|
||
|
print STDERR ">";
|
||
|
# Substitute
|
||
|
$line =~ s/”/"/g;
|
||
|
};
|
||
|
|
||
|
|
||
|
print $line . "\n";
|
||
|
};
|
||
|
print STDERR "finished\n";
|