summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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 '```'
}