X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=doclib%2Ffilter.pl;h=dd192c8eeb8ba4c0778354fb50f32046362c81a1;hb=3d5b1045dc2531f239a3af4a8f3b17b1fe31549c;hp=0fd65d3a76a70e13c83b190f632135c6d8afa278;hpb=5a5c6d7f0fae7ad6c0af49d7742955cb6cf618cf;p=senf.git diff --git a/doclib/filter.pl b/doclib/filter.pl index 0fd65d3..dd192c8 100755 --- a/doclib/filter.pl +++ b/doclib/filter.pl @@ -1,8 +1,14 @@ #!/usr/bin/perl -n -if (/^\s*\\code\s*$/ .. /\\endcode/) { - $i=length((/^(\s*)/)[0]) if /^\s*\\code\s*$/; - print substr($_,$i); +s/\s*$//; +while (s/\t/' 'x(8-length($`)%8)/e) {} + +if (/^\s*\\code$/ .. /\\endcode/ && !/^$/) { + $i=length($1) if /^(\s*)\\code$/; + print substr($_,$i),"\n"; +} elsif (s/^(\s*)
$/$1/ .. /<\/pre>/ && !/^$/) { + $i=length($1) if /^(\s*)$/; + print substr($_,$i),"\n"; } else { - print; + print $_,"\n"; }