fix: bound document nesting and escape generated urls

This commit is contained in:
randogoth 2026-10-04 22:30:44 +03:00
parent c29364d8e0
commit 49a63503d0
10 changed files with 276 additions and 19 deletions

View file

@ -80,7 +80,7 @@ mod tests {
use super::*;
fn render(renderer: &dyn Renderer, markdown: &str) -> String {
let doc = parse::markdown(markdown);
let doc = parse::markdown(markdown).unwrap();
let settings = PageSettings::default();
let ctx = RenderCtx { url: "/x", title: "The Title", settings: &settings, width: None };
String::from_utf8(renderer.render(&doc, &ctx).unwrap().body).unwrap()
@ -225,7 +225,7 @@ mod deck_tests {
/// Parse, then turn `<!-- card X -->` comments into dividers, which is what
/// `directives::apply` does for a real request.
pub fn with_card_breaks(markdown: &str) -> Doc {
let mut doc = parse::markdown(markdown);
let mut doc = parse::markdown(markdown).unwrap();
doc.blocks = doc
.blocks
.into_iter()