aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/text.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-22 16:16:59 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-22 16:16:59 +0200
commit8774b207b7251730eaa7fbfe4f144122a472dda0 (patch)
treece1b8f92a08ff70da265ae8e4484dba2335280a9 /src/construct/text.rs
parent351c69644bdbdf52c95e322904273657892920b5 (diff)
downloadmarkdown-rs-8774b207b7251730eaa7fbfe4f144122a472dda0.tar.gz
markdown-rs-8774b207b7251730eaa7fbfe4f144122a472dda0.tar.bz2
markdown-rs-8774b207b7251730eaa7fbfe4f144122a472dda0.zip
Add support for GFM task list item
Diffstat (limited to 'src/construct/text.rs')
-rw-r--r--src/construct/text.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/construct/text.rs b/src/construct/text.rs
index 9d40585..65f55d4 100644
--- a/src/construct/text.rs
+++ b/src/construct/text.rs
@@ -42,13 +42,21 @@ const MARKERS: [u8; 10] = [
/// Start of text.
///
+/// There is a slightly weird case where task list items have their check at
+/// the start of the first paragraph.
+/// So we start by checking for that.
+///
/// ```markdown
/// > | abc
/// ^
/// ```
pub fn start(tokenizer: &mut Tokenizer) -> State {
tokenizer.tokenize_state.markers = &MARKERS;
- State::Retry(StateName::TextBefore)
+ tokenizer.attempt(
+ State::Next(StateName::TextBefore),
+ State::Next(StateName::TextBefore),
+ );
+ State::Retry(StateName::GfmTaskListItemCheckStart)
}
/// Before text.