swerc

anselm's simpler werc fork
git clone git://git.suckless.org/swerc
Log | Files | Refs | README

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:
Mbin/werc.rc | 7++-----
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/</\&lt;/g; s/>/\&gt;/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/</\&lt;/g; s/>/\&gt;/g' < $1 | fmt -l 82 -j } '</pre>' } fn dir_listing_handler {