diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-11 17:00:07 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-11 17:00:07 +0200 |
commit | 90969231bfcdfcd09bae646abba17d832b633376 (patch) | |
tree | b85321bc25c1888a3ee7adc7420ed3ce8f188cb0 /src/tokenizer.rs | |
parent | a4dc19af6e82757af87c6658d7b1771a9694b83d (diff) | |
download | markdown-rs-90969231bfcdfcd09bae646abba17d832b633376.tar.gz markdown-rs-90969231bfcdfcd09bae646abba17d832b633376.tar.bz2 markdown-rs-90969231bfcdfcd09bae646abba17d832b633376.zip |
Refactor to handle definitions when parsing
Diffstat (limited to 'src/tokenizer.rs')
-rw-r--r-- | src/tokenizer.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs index 8ff19c3..fdca6c5 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -165,6 +165,9 @@ pub struct TokenizeState<'a> { /// Used when tokenizing [text content][crate::content::text]. pub media_list: Vec<Media>, + /// List of defined identifiers. + pub definitions: Vec<String>, + /// Whether to connect tokens. pub connect: bool, /// Marker. @@ -274,18 +277,18 @@ impl<'a> Tokenizer<'a> { document_data_index: None, document_child_state: None, document_child: None, + definitions: vec![], + end: 0, + label_start_stack: vec![], + label_start_list_loose: vec![], marker: 0, marker_b: 0, markers: &[], + media_list: vec![], seen: false, size: 0, size_b: 0, size_c: 0, - start: 0, - end: 0, - label_start_stack: vec![], - label_start_list_loose: vec![], - media_list: vec![], space_or_tab_eol_content_type: None, space_or_tab_eol_connect: false, space_or_tab_eol_ok: false, @@ -295,6 +298,7 @@ impl<'a> Tokenizer<'a> { space_or_tab_max: 0, space_or_tab_size: 0, space_or_tab_token: Name::SpaceOrTab, + start: 0, token_1: Name::Data, token_2: Name::Data, token_3: Name::Data, |