-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathfixhtml.pl
61 lines (49 loc) · 827 Bytes
/
fixhtml.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/perl
#
# Prettify and fix pod2html output
#
# $Id: fixhtml.pl,v 1.2 2003-07-06 13:59:49 ndwinton Exp $
#
while (<>)
{
# Insert style
if (/\<\/HEAD\>/i)
{
print <<'EOF';
<style>
<!--
body, p, h1, h2, h3, h4, h5, td {
font-family: Verdana, Arial, Helvetica, sans-serif;
}
h1, h2, h3, h4, h5 {
color: blue;
}
p, td {
font-size: 12pt;
}
pre {
font-family: Courier New, Courier, monospace;
font-size: 11pt;
}
code {
font-family: Courier New, Courier, monospace;
font-size: 12pt;
}
-->
</style>
EOF
}
# Fix double quotes
s/``/\“/g;
s/''/\”/g;
# Fix single quotes
s/'/\’/g;
# Fix em-dashes
s/---/\—/g;
# Add </P> to the end of paragraphs
if (/^\<P\>/ .. /^$/)
{
print("</P>\n") if (/^$/);
}
print;
}