diff options
Diffstat (limited to '')
l--------- | v2/src/content/img/link.svg | 1 | ||||
-rwxr-xr-x | v2/src/development/genhtml.sh | 11 |
2 files changed, 7 insertions, 5 deletions
diff --git a/v2/src/content/img/link.svg b/v2/src/content/img/link.svg new file mode 120000 index 0000000..bf69c40 --- /dev/null +++ b/v2/src/content/img/link.svg @@ -0,0 +1 @@ +../../../../static/link.svg
\ No newline at end of file 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 ) |