vuepress-bar icon indicating copy to clipboard operation
vuepress-bar copied to clipboard

sort correctly when subsection appears before file

Open andreaswachowski opened this issue 1 year ago • 0 comments

When comparing the title when the child is an object, the associated folder-structure is ignored, which leads to weird results. This fix will recursively look for a string-child, thus preserving the folder structure in the comparison and maintaining the desired sort order.

Try the test case without the fix: The main sections will switch places, so that section 02 appears before section 01.

This only happens, however, with a subsection (here 01-section/a) that is alphabetically before the second child (here 01-section/b). When the folder a were renamed to c, the original logic works as expected.

andreaswachowski avatar Nov 08 '23 18:11 andreaswachowski