Skip to content
Permalink
Browse files

fix(post): 🐛 fix order of table of content subitems

  • Loading branch information
kitos committed Sep 15, 2019
1 parent 72fcc1d commit 2503a315474b366c36a4ad561da59341472606c6
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/components/blog/TableOfContent.re
@@ -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;

0 comments on commit 2503a31

Please sign in to comment.
You can’t perform that action at this time.