3 # postconffix - add HTML paragraphs
7 # - Process input as text blocks separated by one or more empty
8 # (or all whitespace) lines.
10 # - Don't touch blocks that start with `<' in column zero.
12 # The only changes made are:
14 # - Put <p>..</p> around text blocks that start in column zero.
16 # - Put <pre>..</pre> around text blocks that start elsewhere.
24 #die "Usage: $0 [-hv]\n" if ($opt_h);
26 #push @ARGV, "/dev/null"; # XXX
30 # Pass through comments and blank linkes before a text block.
36 # Gobble up the next text block.
41 } while(($_ = <>) && /\S/);
43 # Don't touch a text block starting with < in column zero.
49 elsif ($block =~ /^%/) {
54 elsif ($block =~ /^\S+\s=/) {
55 print "<pre>\n$block</pre>\n\n";
58 # Pre-formatted block.
59 elsif ($block =~ /^\s/) {
60 print "<pre>\n$block</pre>\n\n";
64 elsif ($block =~ /^\S/) {
65 print "<p>\n$block</p>\n\n";
70 die "Unrecognized text block:\n$block";