mirror of https://github.com/tLDP/LDP
49 lines
863 B
Perl
Executable File
49 lines
863 B
Perl
Executable File
#!/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
|
|
# 20020713: spelling fix
|
|
#
|
|
# Known bugs:
|
|
# Entity must be in one line
|
|
|
|
print STDERR "INF : Replacing special quotes entities\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";
|