summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-04-21 11:50:14 +0300
committerPaul Buetow <paul@buetow.org>2024-04-21 11:50:14 +0300
commit3b2c08c38d33b54c5e4af61933cede43f40e855c (patch)
tree2db930d550ced1fa0f9a21bfae327faba27feeec
parent0377059719b0e7ceef084f6d5c42fe02cb01e2d2 (diff)
fix
-rw-r--r--lib/template.source.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/template.source.sh b/lib/template.source.sh
index 5d9e4c1..a18e00f 100644
--- a/lib/template.source.sh
+++ b/lib/template.source.sh
@@ -94,7 +94,7 @@ template::inline::index () {
template::inline::toc () {
echo '```'
echo 'Table of contents:'
- $GREP '^#' "$(basename "$CURRENT_TPL")" | $SED 's/#/ /g; s/^ //;'
+ $GREP '^#' "$(basename "$CURRENT_TPL")" | $SED -E -n '/^#+ / { s/#/ /g; s/^ //; p; }'
echo '```'
}