Skip to content

Commit 5b4c557

Browse files
committed
Simplify sanitation
It seems to suffice to use `str downcase` followed by `str kebab-case` to arrive at the same behavior as the markdown anchor generation. Using `str downcase` before ensures that CamelCase doesn't get converted erroneously.
1 parent 51c6a24 commit 5b4c557

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

make_release/release-note/notes.nu

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,7 @@ export def write-toc [file: path] {
8383
let link = (
8484
$text
8585
| str downcase
86-
| str replace -a '`' ''
87-
| str replace -a '+' ''
88-
| str replace -a '.' ''
89-
| str replace -a '?' ''
90-
| str replace -a ' ' '-'
91-
| str replace -a '_' '-'
92-
| str replace -a -r '--+' '-'
86+
| str kebab-case
9387
)
9488

9589
$"($indent)[_($text)_]\(#($link)-toc\)"

0 commit comments

Comments
 (0)