From 8774b207b7251730eaa7fbfe4f144122a472dda0 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 22 Aug 2022 16:16:59 +0200 Subject: Add support for GFM task list item --- src/util/skip.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/util/skip.rs') diff --git a/src/util/skip.rs b/src/util/skip.rs index a7de408..df63498 100644 --- a/src/util/skip.rs +++ b/src/util/skip.rs @@ -59,12 +59,20 @@ fn skip_opt_impl(events: &[Event], mut index: usize, names: &[Name], forward: bo balance - 1 }; + let next = if forward { + index + 1 + } else if index > 0 { + index - 1 + } else { + index + }; + if events[index].name == *current && balance == 0 { - index = if forward { index + 1 } else { index - 1 }; + index = next; break; } - index = if forward { index + 1 } else { index - 1 }; + index = next; } } -- cgit