about summary refs log tree commit diff
path: root/mless
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-29 17:12:37 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-29 17:12:37 +0200
commit85cbd9976b1104ce0f23d39385197548117734f2 (patch)
treeb5eff435cf07d7b23de5bb0f55b4e078dd52aab9 /mless
parent08f5a8e1ddc2e4699f0e3aa4704fc37f1577ed9d (diff)
downloadmblaze-85cbd9976b1104ce0f23d39385197548117734f2.tar.gz
mblaze-85cbd9976b1104ce0f23d39385197548117734f2.tar.xz
mblaze-85cbd9976b1104ce0f23d39385197548117734f2.zip
mless: H to toggle HTML rendering
Diffstat (limited to 'mless')
-rwxr-xr-xmless11
1 files changed, 10 insertions, 1 deletions
diff --git a/mless b/mless
index 97bce56..06e7312 100755
--- a/mless
+++ b/mless
@@ -47,7 +47,11 @@ if [ "$1" = --filter ]; then
 	fi
 
 	if [ $MLESS_RAW -eq 0 ]; then
-		mshow "$2" | colormsg
+		if [ $MLESS_HTML -eq 1 ]; then
+			mshow -A text/html "$2"
+		else
+			mshow "$2"
+		fi | colormsg
 	else
 		mseq -r $2
 		echo
@@ -78,6 +82,7 @@ fi
 nl="
 "
 export MLESS_RAW=0
+export MLESS_HTML=0
 while :; do
 	[ -f $HOME/.mless ] && export LESSKEY=$HOME/.mless
 	LESSOPEN="|$0 --filter %s" \
@@ -97,5 +102,9 @@ while :; do
 		;;
 	82) # R toggle raw mode
 		MLESS_RAW=$((1-$MLESS_RAW))
+		;;
+	72) # H toggle HTML mode
+		MLESS_HTML=$((1-$MLESS_HTML))
+		;;
 	esac
 done