Navigation Menu

Skip to content

Commit

Permalink
fix(post): 🐛 fix order of table of content subitems
Browse files Browse the repository at this point in the history
  • Loading branch information
kitos committed Sep 15, 2019
1 parent 72fcc1d commit 2503a31
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/blog/TableOfContent.re
Expand Up @@ -10,7 +10,13 @@ let toTree = headings =>

snd(last) == snd(current)
? [(current, []), lastNode, ...rest]
: [(fst(lastNode), [(current, []), ...snd(lastNode)]), ...rest];
: [
(
fst(lastNode),
Belt_List.concat(snd(lastNode), [(current, [])]),
),
...rest,
];
}
)
|> Belt_List.reverse;
Expand Down

0 comments on commit 2503a31

Please sign in to comment.