Skip to content

Commit 51c6a24

Browse files
committed
Fix table of contents generation for release notes
- [x] fixed typo: `table-of-content` in the backreference - [x] missing sanitization of `_`,`+`,`.`,`?` - [ ] handling the confusion of h1 `#` and comment `#`
1 parent ba13f5c commit 51c6a24

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

make_release/release-note/notes.nu

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export def pr-table [] {
4444
| to md
4545
}
4646

47-
const toc = '[[toc](#table-of-content)]'
47+
const toc = '[[toc](#table-of-contents)]'
4848

4949
# Generate and write the table of contents to a release notes file
5050
export def write-toc [file: path] {
@@ -82,8 +82,13 @@ export def write-toc [file: path] {
8282

8383
let link = (
8484
$text
85+
| str downcase
8586
| str replace -a '`' ''
87+
| str replace -a '+' ''
88+
| str replace -a '.' ''
89+
| str replace -a '?' ''
8690
| str replace -a ' ' '-'
91+
| str replace -a '_' '-'
8792
| str replace -a -r '--+' '-'
8893
)
8994

0 commit comments

Comments
 (0)