From c96ced1f60f4f2560926ac6d965bb29fcef9ff84 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 8 Jun 2020 00:14:10 -0500 Subject: Add quote support to text/gemini typesetting --- bollux | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bollux b/bollux index 7aa2de8..55ae15b 100755 --- a/bollux +++ b/bollux @@ -715,6 +715,9 @@ typeset_gemini() { '*'[[:space:]]*) gemini_list "$REPLY" $pre ;; + '>'*) + gemini_quote "$REPLY" $pre + ;; *) gemini_text "$REPLY" $pre ;; esac done @@ -776,6 +779,21 @@ gemini_list() { fi } +gemini_quote() { + local re="^(>)[[:blank:]]*(.*)" + local s t a l + if ! ${2-false} && [[ "$1" =~ $re ]]; then + s="${BASH_REMATCH[1]}" + t="${BASH_REMATCH[2]}" + + printf "\e[${C_SIGIL}m%${S_MARGIN}s " "$s" + printf -v l "\e[${C_LIST}m%s${C_RESET}\n" "$t" + fold_line "$WIDTH" "$l" + else + gemini_pre "$1" + fi +} + gemini_text() { if ! ${2-false}; then printf "%${S_MARGIN}s " ' ' -- cgit 1.4.1-21-gabe81