Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrmont committed Dec 14, 2024
1 parent b9d74b6 commit 717c412
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/documentarian.janet
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@
```
# Uses the algorithm at https://github.com/gjtorikian/html-pipeline/blob/main/lib/html/pipeline/toc_filter.rb
[name]
(def key (-> (peg/match ~{:main (% (any (+ :kept :changed :ignored)))
:kept (<- (+ :w+ (set "_-")))
:changed (/ (<- " ") "-")
:ignored 1}
(def key (-> (peg/match ~{:main (% (any (+ :kept :changed :ignored)))
:kept (<- (+ :w+ (set "_-")))
:changed (/ (<- " ") "-")
:ignored 1}
name)
(first)))
(def i (or (get headings key) 0))
(def i (get headings key 0))
(put headings key (inc i))
(if (zero? i)
key
Expand Down
4 changes: 2 additions & 2 deletions test/documentarian.janet
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
(def expect
(string "# Example API\n\n"
"## example\n\n"
"[example](#example), "
"[example*](#example-1), "
"[example](#example-1), "
"[example*](#example-2), "
"[example2](#example2)\n\n"
"## example\n\n"
"**function** | [source][1]\n\n\n"
Expand Down

0 comments on commit 717c412

Please sign in to comment.