html: treat FixedWidth lines as mini example blocks

This commit is contained in:
xfnw 2024-07-01 21:48:17 -04:00
parent c3c8676524
commit 73aaa39c08

View File

@ -226,6 +226,8 @@ impl Traverser for Handler {
self.exp.push_str(HtmlEscape(foot.raw()).to_string());
ctx.skip();
}
Event::Enter(Container::FixedWidth(_)) => self.exp.push_str("<pre class=\"example\">"),
Event::Leave(Container::FixedWidth(_)) => self.exp.push_str("</pre>"),
Event::Cookie(cookie) => {
self.exp.push_str(HtmlEscape(cookie.raw()).to_string());
}