about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xbollux18
1 files changed, 18 insertions, 0 deletions
diff --git a/bollux b/bollux index 7aa2de8..55ae15b 100755 --- a/bollux +++ b/bollux
@@ -715,6 +715,9 @@ typeset_gemini() {
715 '*'[[:space:]]*) 715 '*'[[:space:]]*)
716 gemini_list "$REPLY" $pre 716 gemini_list "$REPLY" $pre
717 ;; 717 ;;
718 '>'*)
719 gemini_quote "$REPLY" $pre
720 ;;
718 *) gemini_text "$REPLY" $pre ;; 721 *) gemini_text "$REPLY" $pre ;;
719 esac 722 esac
720 done 723 done
@@ -776,6 +779,21 @@ gemini_list() {
776 fi 779 fi
777} 780}
778 781
782gemini_quote() {
783 local re="^(>)[[:blank:]]*(.*)"
784 local s t a l
785 if ! ${2-false} && [[ "$1" =~ $re ]]; then
786 s="${BASH_REMATCH[1]}"
787 t="${BASH_REMATCH[2]}"
788
789 printf "\e[${C_SIGIL}m%${S_MARGIN}s " "$s"
790 printf -v l "\e[${C_LIST}m%s${C_RESET}\n" "$t"
791 fold_line "$WIDTH" "$l"
792 else
793 gemini_pre "$1"
794 fi
795}
796
779gemini_text() { 797gemini_text() {
780 if ! ${2-false}; then 798 if ! ${2-false}; then
781 printf "%${S_MARGIN}s " ' ' 799 printf "%${S_MARGIN}s " ' '