lib: add Render::render_{event, prologue, epilogue}

derive push/write automatically from these
This commit is contained in:
Noah Hellman 2023-03-19 18:44:58 +01:00
parent e506fffed8
commit e8503e28fd
8 changed files with 73 additions and 48 deletions

View file

@ -19,7 +19,9 @@ pub fn html(data: &[u8]) {
if !s.contains("=html") {
let p = jotdown::Parser::new(s);
let mut html = "<!DOCTYPE html>\n".to_string();
jotdown::html::Renderer.push(p, &mut html).unwrap();
jotdown::html::Renderer::default()
.push(p, &mut html)
.unwrap();
validate_html(&html);
}
}

View file

@ -14,7 +14,9 @@ macro_rules! suite_test {
let expected = $expected;
let p = jotdown::Parser::new(src);
let mut actual = String::new();
jotdown::html::Renderer.push(p, &mut actual).unwrap();
jotdown::html::Renderer::default()
.push(p, &mut actual)
.unwrap();
assert_eq!(
actual.trim(),
expected.trim(),