From 9ad249a38a07f57c1bb9d14302ea59d478d9f6b8 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 25 Mar 2023 15:00:49 +0200 Subject: can also use "<< <<< and >>>" from templates themselves --- README.md | 1 - lib/template.source.sh | 12 +++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1aa5727..c7cb637 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,6 @@ See more entries about DTail and Golang: Blablabla... ``` - ### Alternative configuration file path If you don't want to mess with `gemtexter.conf`, you can use an alternative config file path in `~/.config/gemtexter.conf`, which takes precedence if it exists. Another way is to set the `CONFIG_FILE_PATH` environment variable, e.g.: diff --git a/lib/template.source.sh b/lib/template.source.sh index 38d9d3d..ec49490 100644 --- a/lib/template.source.sh +++ b/lib/template.source.sh @@ -57,7 +57,7 @@ $line" echo "$line" ;; esac - done + done | $SED 's/^\[\[\[/<<>>/; s/^\[\[/<>> << :' assert::equals "$(template::_generate <<< "$template4")" '' + + local -r template5='[[ echo foo +[[[ + echo bar +]]]' + local -r expect5='<< echo foo +<<< + echo bar +>>>' + assert::equals "$(template::_generate <<< "$template5")" "$expect5" } -- cgit v1.2.3