commit 3e053defeba4af29ecfc903d8793dae254daa184
parent 47bea0fa5dede364ae4d0132be19a92bf9fcfefb
Author: uriel@engel.se.cat-v.org <unknown>
Date: Sun, 4 Jan 2009 03:59:52 +0100
Simplify .txt handler, and remove double spacing, if lines are too close we should use css to space them.
Diffstat:
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/bin/werc.rc b/bin/werc.rc
@@ -83,11 +83,8 @@ fn html_handler {
}
fn txt_handler {
- echo '<pre>'
- # XXX Insering a blank line between lines in input is good for fortunes.txt, but maybe not for other .txt files
- # XXX Words are not broken, even if they are way beyond 82 chars long
- cat $1 | sed 's/$/\n/g; s/</\</g; s/>/\>/g' | fmt -l 82 -j
- echo '</pre>'
+ # Note: Words are not broken, even if they are way beyond 82 chars long
+ echo '<pre>' `{ sed 's/</\</g; s/>/\>/g' < $1 | fmt -l 82 -j } '</pre>'
}
fn dir_listing_handler {