about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xjimmy21
1 files changed, 16 insertions, 5 deletions
diff --git a/jimmy b/jimmy index a85c448..ed6c2b7 100755 --- a/jimmy +++ b/jimmy
@@ -68,12 +68,14 @@ gmi() {
68 68
69### Filters 69### Filters
70 70
71filter_buff_html(){ cat; }
72
71filter_buff() { 73filter_buff() {
72 f="filter_buff_$to" 74 f="filter_buff_$to"
73 if type "$f" | grep -q function 75 if type "$f" | grep -q function
74 then "$f" | sed -e "s/$nl/\n/g" -e "s/$sp/ /g" # fix whitespace 76 then "$f"
75 else sed -e "s/$nl/\n/g" -e "s/$sp/ /g" 77 else cat
76 fi 78 fi | sed -e "s/$nl/\n/g" -e "s/$sp/ /g" # fix whitespace
77} 79}
78 80
79filter_line() { 81filter_line() {
@@ -106,8 +108,7 @@ pushline() {
106} 108}
107 109
108bufprint() { 110bufprint() {
109 b="$(cat<"$buff" | filter_buff)" 111 b="$(cat<"$buff")"
110 test -n "$b" || return
111 printf "$(eval echo "\$fmtbuff_$1")" "$b" | filter_buff 112 printf "$(eval echo "\$fmtbuff_$1")" "$b" | filter_buff
112 : > "$buff" 113 : > "$buff"
113} 114}
@@ -131,6 +132,16 @@ process() {
131 verbatim=false 132 verbatim=false
132 prev= 133 prev=
133 else 134 else
135 # CONSIDER: "types" of verbatim
136 # designated by extra fields after the
137 # sigil
138 ## ``` class_of_content
139 # ^- change the class of the content,
140 # eg. in html do <pre class="type">
141 # other formats might do other things
142 ## ``` | some_program
143 # ^- pipe the buffer to some_program
144 ## others?
134 bufprint "$prev" 145 bufprint "$prev"
135 verbatim=true 146 verbatim=true
136 fi 147 fi