From 1ea0b05d96c88daa25da7bcfec727932448862cc Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 13 May 2024 12:44:06 -0500 Subject: Fix filters --- jimmy | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/jimmy b/jimmy index a85c448..ed6c2b7 100755 --- a/jimmy +++ b/jimmy @@ -68,12 +68,14 @@ gmi() { ### Filters +filter_buff_html(){ cat; } + filter_buff() { f="filter_buff_$to" if type "$f" | grep -q function - then "$f" | sed -e "s/$nl/\n/g" -e "s/$sp/ /g" # fix whitespace - else sed -e "s/$nl/\n/g" -e "s/$sp/ /g" - fi + then "$f" + else cat + fi | sed -e "s/$nl/\n/g" -e "s/$sp/ /g" # fix whitespace } filter_line() { @@ -106,8 +108,7 @@ pushline() { } bufprint() { - b="$(cat<"$buff" | filter_buff)" - test -n "$b" || return + b="$(cat<"$buff")" printf "$(eval echo "\$fmtbuff_$1")" "$b" | filter_buff : > "$buff" } @@ -131,6 +132,16 @@ process() { verbatim=false prev= else + # CONSIDER: "types" of verbatim + # designated by extra fields after the + # sigil + ## ``` class_of_content + # ^- change the class of the content, + # eg. in html do
+					# other formats might do other things
+					## ``` | some_program
+					# ^- pipe the buffer to some_program
+					## others?
 					bufprint "$prev"
 					verbatim=true
 				fi
-- 
cgit 1.4.1-21-gabe81