diff options
author | EuAndreh <eu@euandre.org> | 2023-04-04 17:53:27 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-04-04 17:53:27 -0300 |
commit | 6b7d170738b4beac4223c9a29255a9044b63bf76 (patch) | |
tree | 81c6400b440f4a135b1fa5fd7ffcf00c9bc48880 /v2/src/development/genhtml.sh | |
parent | v2: git mv src/development/getconf.sh src/development/genconf.sh (diff) | |
download | euandre.org-6b7d170738b4beac4223c9a29255a9044b63bf76.tar.gz euandre.org-6b7d170738b4beac4223c9a29255a9044b63bf76.tar.xz |
v2: Recove h[2-6] anchor link and icon
Diffstat (limited to 'v2/src/development/genhtml.sh')
-rwxr-xr-x | v2/src/development/genhtml.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/v2/src/development/genhtml.sh b/v2/src/development/genhtml.sh index f3a6e3a..1b2718a 100755 --- a/v2/src/development/genhtml.sh +++ b/v2/src/development/genhtml.sh @@ -192,19 +192,20 @@ add_headings_anchors() { ( IFS='' while read -r line; do - if ! printf '%s' "$line" | grep -q '^<h[2-6]>'; then + if ! printf '%s' "$line" | grep -q "^$INDENT<h[2-6]>"; then printf '%s\n' "$line" continue fi - LVL="$(printf '%s' "$line" | sed 's|^<h\(.\)>.*|\1|')" - HEADING="$(printf '%s' "$line" | sed 's|^<h.>\(.*\)</h.>$|\1|')" + LVL="$(printf '%s' "$line" | sed "s|^$INDENT<h\(.\)>.*|\1|")" + HEADING="$(printf '%s' "$line" | sed "s|^$INDENT<h.>\(.*\)</h.>$|\1|")" SLUG="$(slugify_once "$HEADING")" - printf '<h%s class="header-anchor" id="%s">%s<a href="#%s" aria-hidden="true"><img class="svg-icon" src="%s" /></a></h%s>\n' \ + printf '%s<h%s class="header-anchor" id="%s">%s<a href="#%s" aria-hidden="true"><img class="svg-icon" src="%s" /></a></h%s>\n' \ + "$INDENT" \ "$LVL" \ "$SLUG" \ "$HEADING" \ "$SLUG" \ - "$(url-for 'static/link.svg')" \ + "${icon_link_url:?}" \ "$LVL" done ) |