fix: Title formatting parsing fix
All checks were successful
Lint / shellcheck (push) Successful in 18s

This commit is contained in:
2026-03-17 02:18:42 +01:00
parent 62075dea4a
commit 99e805b180

View File

@@ -487,6 +487,7 @@ render_markdown() {
if [ "$generate_page_title" = "true" ] && [ -n "$file" ] && [ -f "$file" ]; then if [ "$generate_page_title" = "true" ] && [ -n "$file" ] && [ -f "$file" ]; then
first_heading=$(grep -m 1 '^# ' "$file" | sed 's/^# *//; s/ *$//') first_heading=$(grep -m 1 '^# ' "$file" | sed 's/^# *//; s/ *$//')
if [ -n "$first_heading" ]; then if [ -n "$first_heading" ]; then
first_heading=$(echo "$first_heading" | sed -e 's/\[//g' -e 's/\]//g' -e 's/!//g' -e 's/\*//g' -e 's/_//g' -e 's/`//g' -e 's/([^)]*)//g' | sed 's/\\//g')
page_title="$first_heading - $title" page_title="$first_heading - $title"
else else
basename_no_ext=$(basename "$file" .md) basename_no_ext=$(basename "$file" .md)