diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-09-28 17:54:39 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-09-28 17:55:44 +0200 |
commit | b33a81e40620b8b3eaeeec9d0e0b34ca5958dead (patch) | |
tree | c91e56db38777b30cdcef591d0f7cd9bd1ac0ee8 /src/resolve.rs | |
parent | a0c84c505d733be2e987a333a34244c1befb56cb (diff) | |
download | markdown-rs-b33a81e40620b8b3eaeeec9d0e0b34ca5958dead.tar.gz markdown-rs-b33a81e40620b8b3eaeeec9d0e0b34ca5958dead.tar.bz2 markdown-rs-b33a81e40620b8b3eaeeec9d0e0b34ca5958dead.zip |
Add support for turning mdast to hast
Diffstat (limited to 'src/resolve.rs')
-rw-r--r-- | src/resolve.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/resolve.rs b/src/resolve.rs index 2586676..813ce52 100644 --- a/src/resolve.rs +++ b/src/resolve.rs @@ -64,18 +64,18 @@ pub enum Name { /// Call the corresponding resolver. pub fn call(tokenizer: &mut Tokenizer, name: Name) -> Result<Option<Subresult>, String> { - let func = match name { - Name::Label => construct::label_end::resolve, - Name::Attention => construct::attention::resolve, - Name::GfmTable => construct::gfm_table::resolve, - Name::HeadingAtx => construct::heading_atx::resolve, - Name::HeadingSetext => construct::heading_setext::resolve, - Name::ListItem => construct::list_item::resolve, - Name::Content => construct::content::resolve, - Name::Data => construct::partial_data::resolve, - Name::String => construct::string::resolve, - Name::Text => construct::text::resolve, + let result = match name { + Name::Label => construct::label_end::resolve(tokenizer), + Name::Attention => construct::attention::resolve(tokenizer), + Name::GfmTable => construct::gfm_table::resolve(tokenizer), + Name::HeadingAtx => construct::heading_atx::resolve(tokenizer), + Name::HeadingSetext => construct::heading_setext::resolve(tokenizer), + Name::ListItem => construct::list_item::resolve(tokenizer), + Name::Content => construct::content::resolve(tokenizer)?, + Name::Data => construct::partial_data::resolve(tokenizer), + Name::String => construct::string::resolve(tokenizer), + Name::Text => construct::text::resolve(tokenizer), }; - func(tokenizer) + Ok(result) } |