Skip to content

Commit da781c5

Browse files
committedFeb 14, 2025
fix(templ): fix grouping for in cssref sidebar
This ignores leading : and - for grouping
1 parent 8dce98a commit da781c5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎crates/rari-doc/src/helpers/subpages.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,12 @@ pub fn list_sub_pages_flattened_grouped_internal(
244244
}
245245
let title = sub_page.title();
246246
let prefix_index = if !title.is_empty() {
247-
title[1..].find('-').map(|i| i + 1)
247+
title
248+
.chars()
249+
.enumerate()
250+
.skip_while(|(_, c)| matches!(c, ':' | '-'))
251+
.find(|(_, c)| *c == '-')
252+
.map(|(i, _)| i)
248253
} else {
249254
None
250255
};

0 commit comments

Comments
 (0)
Please sign in to comment.