File tree 3 files changed +13
-2
lines changed
src/renderer/html_handlebars/helpers
3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,15 @@ fn find_chapter(
69
69
// "index.md" (unless there really is an index.md in SUMMARY.md).
70
70
match target {
71
71
Target :: Previous => return Ok ( None ) ,
72
- Target :: Next => match chapters. iter ( ) . skip ( 1 ) . next ( ) {
72
+ Target :: Next => match chapters
73
+ . iter ( )
74
+ . filter ( |chapter| {
75
+ // Skip things like "spacer"
76
+ chapter. contains_key ( "path" )
77
+ } )
78
+ . skip ( 1 )
79
+ . next ( )
80
+ {
73
81
Some ( chapter) => return Ok ( Some ( chapter. clone ( ) ) ) ,
74
82
None => return Ok ( None ) ,
75
83
} ,
Original file line number Diff line number Diff line change 1
1
# Summary
2
2
3
3
[ Dummy Book] ( README.md )
4
+
5
+ ---
6
+
4
7
[ Introduction] ( intro.md )
5
8
6
9
- [ First Chapter] ( first/index.md )
Original file line number Diff line number Diff line change @@ -306,7 +306,7 @@ fn check_first_toc_level() {
306
306
#[ test]
307
307
fn check_spacers ( ) {
308
308
let doc = root_index_html ( ) . unwrap ( ) ;
309
- let should_be = 1 ;
309
+ let should_be = 2 ;
310
310
311
311
let num_spacers = doc
312
312
. find ( Class ( "chapter" ) . descendant ( Name ( "li" ) . and ( Class ( "spacer" ) ) ) )
You can’t perform that action at this time.
0 commit comments