We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5eee64b commit 59910acCopy full SHA for 59910ac
1 file changed
src/Mdx.res
@@ -59,10 +59,14 @@ external childrenToString: {..} => string = "toString"
59
let sortSection = mdxPages =>
60
Array.toSorted(mdxPages, (a: attributes, b: attributes) =>
61
switch (a.order, b.order) {
62
- | (Some(a), Some(b)) => a > b ? 1.0 : -1.0
+ | (Some(orderA), Some(orderB)) =>
63
+ switch Int.compare(orderA, orderB) {
64
+ | 0 => String.compare(a.title, b.title)->Int.toFloat
65
+ | result => result->Int.toFloat
66
+ }
67
| (Some(_), None) => -1.0
68
| (None, Some(_)) => 1.0
- | (None, None) => 0.0
69
+ | (None, None) => String.compare(a.title, b.title)->Int.toFloat
70
}
71
)
72
0 commit comments