From 39b184e40e2d707e3d63ce7b907a0abb86dae06a Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Mon, 7 Mar 2022 00:18:20 +0100 Subject: [PATCH] Refine multi line codeblock formating Some shells set the line background for complete terminal width instead of only the available characters to print --- catmd.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/catmd.sh b/catmd.sh index c498f01..6ecd03c 100755 --- a/catmd.sh +++ b/catmd.sh @@ -190,12 +190,15 @@ parseline() { 5) ## Multiline code blocks ## if [[ "$tocheck" =~ $rex_codeblock ]]; then if isfix; then - format_suffix="${FO_RESET}" unfix else - format_prefix="${FO_CODEBLOCK}" fix fi + format_prefix="${FO_CODEBLOCK}" + format_suffix="${FO_RESET}" + elif isfix; then + format_prefix="${FO_CODEBLOCK}" + format_suffix="${FO_RESET}" fi fall || break;; 6) ## Code block started with spaces