| 40 |
|
|
| 41 |
# Main program |
# Main program |
| 42 |
|
|
| 43 |
|
$innf = 0; |
| 44 |
$inpara = 0; |
$inpara = 0; |
| 45 |
$inpre = 0; |
$inpre = 0; |
| 46 |
$wrotetext = 0; |
$wrotetext = 0; |
| 82 |
|
|
| 83 |
if (/^\./) |
if (/^\./) |
| 84 |
{ |
{ |
| 85 |
if (/^\.br/) |
# Some of the PCRE man pages used to contain instances of .br. However, |
| 86 |
|
# they should have all been removed because they cause trouble in some |
| 87 |
|
# (other) automated systems that translate man pages to HTML. Complain if |
| 88 |
|
# we find .br or .in (another macro that is deprecated). |
| 89 |
|
|
| 90 |
|
if (/^\.br/ || /^\.in/) |
| 91 |
{ |
{ |
| 92 |
print TEMP "<br>\n" if $wrotetext; |
print STDERR "\n*** Deprecated macro encountered - rewrite needed\n"; |
| 93 |
|
print STDERR "*** $_\n"; |
| 94 |
|
die "*** Processing abandoned\n"; |
| 95 |
} |
} |
| 96 |
|
|
| 97 |
|
# Instead of .br, relevent "literal" sections are enclosed in .nf/.fi. |
| 98 |
|
|
| 99 |
|
elsif (/^\.nf/) |
| 100 |
|
{ |
| 101 |
|
$innf = 1; |
| 102 |
|
} |
| 103 |
|
|
| 104 |
|
elsif (/^\.fi/) |
| 105 |
|
{ |
| 106 |
|
$innf = 0; |
| 107 |
|
} |
| 108 |
|
|
| 109 |
# Handling .sp is subtle. If it is inside a literal section, do nothing if |
# Handling .sp is subtle. If it is inside a literal section, do nothing if |
| 110 |
# the next line is a non literal text line; similarly, if not inside a |
# the next line is a non literal text line; similarly, if not inside a |
| 111 |
# literal section, do nothing if a literal follows. The point being that |
# literal section, do nothing if a literal follows. The point being that |
| 264 |
print TEMP "</pre>\n"; |
print TEMP "</pre>\n"; |
| 265 |
$inpre = 0; |
$inpre = 0; |
| 266 |
} |
} |
| 267 |
|
|
| 268 |
|
# Add <br> to the end of a non-literal line if we are within .nf/.fi |
| 269 |
|
|
| 270 |
|
$_ .= "<br>\n" if (!$inpre && $innf); |
| 271 |
|
|
| 272 |
print TEMP; |
print TEMP; |
| 273 |
$wrotetext = 1; |
$wrotetext = 1; |