demo.html can be included in another html file, create a html file that
includes demo.html for the demo, rather than using demo.html directly
and letting the browser add <html>, <body> etc
make sure attr can keep track of all state so one char can be provided
at a time
this allows not restarting from beginning if we find out we need more
chars to finish parsing attributes
Try to make rendering of each event independent.
The only case where we need to peek is when a backref link should be
added to the last paragraph within a footnote.
Before, when exiting a paragraph, we would peek and add the link before
emitting the close tag if the next event is a the footnote end.
Now, the paragraph end event skips emitting a paragraph close tag if it
is within a footnote. The next event will then always close the
paragraph, and if it is a footnote end, it will add the backref link
before closing.
Whitespace tokens do not necessarily create new events but they work as
a delimiter for words with attributes and affect some container
delimiters. Now when we can read the source from inline, we can instead
inspect for whitespace when needed.
Removing the whitespace token allows the lexer to continue a lot longer
without stopping. E.g. a typical line in a paragraph with no special
characters can turn into a single token.
in order to more conveniently allow pushing in arbitrary order
parse methods now return an Option<()> that functions kind of like a
std::ops::ControlFlow. Some(()) means the token was parsed, None means
continue parsing.
these are primarily used to detect bugs during e.g. fuzzing.
most of these asserts have negligible impact on performance, but if they
are not debug asserts it is not obvious that they dont affect
performance of release builds
for testing that crashes have been resolved
previously, binary of the main crate was used, but targets may have more
validation than simply checking for panics