#!/usr/bin/perl # normalize HTML use Getopt::Long; use File::Slurp; use strict; use warnings; my $force; GetOptions ("force|f"); my $stem = shift; my $_ = read_file( $stem . '.htm' ); # whitespace s/(?: |\h)+/ /mg; # preamble s{.*>HAVE ADOPTED THIS REGULATION:

\s*}{}s; # page header s{]*;top:(?:1172|1187)px;[^>]*>(?:(?!\s*}{}mg; # headline s{]*>(?:In Title \S+, the following Section \S+ is inserted:

\s*]*>)?\'?(SECTION \S+)
((?:(?!

}{

$1

\n

$2

}mg; s{]*>\'?(Article \S+)

}{

$1

}mg; s{]*>(?:Article \S+ is replaced by the following:

\s*]*>)?\'?(Article \S+)
((?:(?!

}{

$1

\n

$2

}mg; s{]*>(Article \S+) is amended as follows:

}{

$1

}mg; s{]*>(?:paragraph \S+ is replaced by the following:

\s*)(]*>)\'?(\d+)\. }{

$2

\n$1}mg; s{]*>In (Article \S+), paragraph (\S+) is replaced by the following:

\s*(]*>)\'?(\2)\. }{

$1

\n

$2

\n$3}mg; # unwrap s{\s*
\s*}{ }mg; write_file( $stem . '.html', $_ ); print "DONE: $0 stem $stem\n"; d class='sub'>Unnamed repository; edit this file 'description' to name the repository.Jonas Smedegaard
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2023-06-27 09:35:08 +0200
committerJonas Smedegaard <dr@jones.dk>2023-06-27 09:35:08 +0200
commitfd54908da2b05c526dd3bee9b6dcd093214a220d (patch)
treec69c845069c99d1d01044f6fafda7c08433329c6 /tags/2c/02/151669742024.1392.3383817174904863181.reportbug@mail.an3as.eu/debian
parentba46132213560cf3335d53560d519c0ec0190da2 (diff)
Diffstat (limited to 'tags/2c/02/151669742024.1392.3383817174904863181.reportbug@mail.an3as.eu/debian')