summaryrefslogtreecommitdiffstats
path: root/regress/regress.pl
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-12-16 00:17:02 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-12-16 00:17:02 +0000
commit0cfd5175e34d41bc422a986950293edb0d8d2c38 (patch)
tree63934b15f1f9821374eb2a81ad104851dbc5cf12 /regress/regress.pl
parent0e3f0b740ea18224c3b2c07114be601dd8be97bb (diff)
downloadmandoc-0cfd5175e34d41bc422a986950293edb0d8d2c38.tar.gz
Yet another round of improvements to manual font selection.
Unify handling of \f and .ft. Support \f4 (bold+italic). Support ".ft BI" and ".ft CW" for terminal output. Support the .ft request in HTML output. Reject the bogus fonts \f(C1, \f(C2, \f(C3, and \f(CP. In regress.pl, only strip leading whitespace in math mode.
Diffstat (limited to 'regress/regress.pl')
-rwxr-xr-xregress/regress.pl20
1 files changed, 11 insertions, 9 deletions
diff --git a/regress/regress.pl b/regress/regress.pl
index 8c62a147..b9fb849b 100755
--- a/regress/regress.pl
+++ b/regress/regress.pl
@@ -79,23 +79,25 @@ sub syshtml ($@) {
open my $outfd, '>', $outfile or die "$outfile: $!";
my $infd;
my $pid = open3 undef, $infd, undef, @_;
- my $state;
+ my $state = 0;
while (<$infd>) {
chomp;
if (!$state && s/.*<math class="eqn">//) {
- $state = 1;
+ $state = 'math';
next unless length;
+ } elsif (/^BEGINTEST/) {
+ $state = 'other';
}
- $state = 1 if /^BEGINTEST/;
- if ($state && s/<\/math>.*//) {
+ if ($state eq 'math') {
s/^ *//;
- print $outfd "$_\n" if length;
- undef $state;
- next;
+ if (s/<\/math>.*//) {
+ print $outfd "$_\n" if length;
+ $state = 0;
+ next;
+ }
}
- s/^ *//;
print $outfd "$_\n" if $state;
- undef $state if /^ENDTEST/;
+ $state = 0 if /^ENDTEST/;
}
close $outfd;
close $infd;