summaryrefslogtreecommitdiff
path: root/doc/doc-docbook/Tidytxt
blob: 02bf9dbd4cee59575f4810f9bcdf6fb11206074e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /usr/bin/perl

# $Cambridge: exim/doc/doc-docbook/Tidytxt,v 1.1 2005/06/16 10:32:31 ph10 Exp $

# Script to tidy up the output of w3m when it makes a text file. We convert
# sequences of blank lines into a single blank line.

$blanks = 0;
while (<>)
  {
  if (/^\s*$/)
    {
    $blanks++;
    next;
    }
  print "\n" if $blanks > 0;
  $blanks = 0;
  print;
  }

# End