Improve emphasize_stuff_in_headers()

Improve emphasize_stuff_in_headers() by matching more than one digit at a time.

The primary benefit of this change is in the HTML, since it does not result in each digit being wrapped by <span style="color:#8a7237;">...</span>
This commit is contained in:
David Cooper
2026-09-22 21:50:39 -07:00
committed by GitHub
parent 4dfbbbaf92
commit a573b4b478
+4 -3
View File
@@ -3381,9 +3381,10 @@ emphasize_stuff_in_headers() (
match="$BASH_REMATCH" match="$BASH_REMATCH"
pr_yellow "$match" pr_yellow "$match"
stuff="${stuff/#$match}" stuff="${stuff/#$match}"
elif [[ "${stuff:0:1}" =~ [0-9] ]]; then elif [[ "$stuff" =~ ^[0-9][0-9][0-9][0-9][0-9][0-9][0-9]|^[0-9][0-9][0-9][0-9][0-9][0-9]|^[0-9][0-9][0-9][0-9][0-9]|^[0-9][0-9][0-9][0-9]|^[0-9][0-9][0-9]|^[0-9][0-9]|^[0-9] ]]; then
pr_brown "${stuff:0:1}" match="$BASH_REMATCH"
stuff="${stuff:1}" pr_brown "$match"
stuff="${stuff/#$match}"
else else
out "${stuff:0:1}" out "${stuff:0:1}"
stuff="${stuff:1}" stuff="${stuff:1}"