Skip to content

Commit

Permalink
Fix: strip _any_ trailing line break character from the titles
Browse files Browse the repository at this point in the history
Otherwise, when parsing *.md files with windows-style line breaks
(CR-LF), one of the line break characters would remain in the title,
thus breaking the markup for the table of content.

npryce#140
  • Loading branch information
anenviousguest authored and halostatue committed Jul 20, 2024
1 parent 648a506 commit d927598
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/_adr_title
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -e
eval "$("$(dirname "$0")"/adr-config)"

head -1 "$("$adr_bin_dir/_adr_file" "$1")" | cut -c 3-
head -1 "$("$adr_bin_dir/_adr_file" "$1")" | cut -c 3- | tr -d '\r\n'

0 comments on commit d927598

Please sign in to comment.