diff options
-rwxr-xr-x | ranger/data/scope.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index 754b54d0..ba8b78bc 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -41,12 +41,13 @@ case "$extension" in exit 1;; # PDF documents: pdf) - pdftotext -q "$path" - | head -n $maxln - success && exit 3 || exit 1;; + pdftotext -l 10 -nopgbrk -q "$path" - | head -n $maxln | fmt -s -w $width + success && exit 0 || exit 1;; # HTML Pages: htm|html|xhtml) - have lynx && lynx -dump "$path" | head -n $maxln && exit 5 - have elinks && elinks -dump "$path" | head -n $maxln && exit 5 + have w3m && w3m -dump "$path" | head -n $maxln | fmt -s -w $width && exit 5 + have lynx && lynx -dump "$path" | head -n $maxln | fmt -s -w $width && exit 5 + have elinks && elinks -dump "$path" | head -n $maxln | fmt -s -w $width && exit 5 ;; # fall back to highlight/cat if theres no lynx/elinks esac |