Open cittadhammo opened 1 week ago
Sounds good! I can poke at these in a couple of weeks when I get back from vacation unless you get to it first. Thank you for the bug reports and suggestions!
Yes, I gave it some thought and started looking at your code. The AI said to implement a custom case to catch any hr in the markdown in there:
with something like:
// Add this case to handle horizontal rules
(_, Some(ParserEvent::Mdbook(MdbookEvent::MarkdownContentEvent(MdEvent::Start(MdTag::HorizontalRule)))) ) => {
// Convert hr to Typst
return Some(ParserEvent::Typst(TypstEvent::Raw(
r#"#hr()"#.into(), // Assuming this is how you'd denote a horizontal line in Typst
)));
}
But I have to say that your code is almost incomprehensible to me plus the layer of that pullup project which is something else you need to understand (events and what not)
If you have some guidance to start learning how it works, I could have a go, but it looks quite advanced to me. I am used to JS and Node projects.
Yeah, the code is pretty ugly because 1) it is broken up into reusable parts (maybe too much!) and 2) everything is iterators, which makes it efficient via stream processing but makes the control flow hard to follow.
hr in markdown are
***
on a new line.In typst they could be
https://github.com/typst/typst/discussions/3708