-
Notifications
You must be signed in to change notification settings - Fork 274
Description
I use a fork following the unreleased version of the main branch (https://github.com/rhysd/pulldown-cmark/tree/math)
In my project, I'm creating my own rendering pipeline from the events Parse created.
To get the children attributes when I match an opening tag, I would like to do something like this:
fn render_tag<'a>(context: &RenderContext, stream: &mut EventStream<'a>, tag: Tag<'a>) -> Result<Html, HtmlError> {
let children =
stream
.take_while(|(event, range)| event != Event::Start(corresponding_closing_tag(tag))
.collect();
match tag {
Tag::Paragraph => todo!(),
Tag::Heading(_, _, _) => todo!(),
Tag::BlockQuote => todo!(),
Tag::CodeBlock(_) => todo!(),
Tag::List(_) => todo!(),
Tag::Item => todo!(),
Tag::FootnoteDefinition(_) => todo!(),
Tag::Table(_) => todo!(),
Tag::TableHead => todo!(),
Tag::TableRow => todo!(),
Tag::TableCell => todo!(),
Tag::Emphasis => todo!(),
Tag::Strong => todo!(),
Tag::Strikethrough => todo!(),
Tag::Link(_, _, _) => todo!(),
Tag::Image(_, _, _) => todo!(),
}
}But it seems there is no way to turn an opening tag into a closing tag, or at leat test if a Tag and a TagEnd match.
Am I missing something ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels