fix: bound document nesting and escape generated urls
This commit is contained in:
parent
c29364d8e0
commit
49a63503d0
10 changed files with 276 additions and 19 deletions
|
|
@ -284,7 +284,7 @@ mod tests_support {
|
|||
|
||||
/// Render a Markdown fragment the way the server would.
|
||||
pub fn render(markdown: &str) -> String {
|
||||
let doc = parse::markdown(markdown);
|
||||
let doc = parse::markdown(markdown).unwrap();
|
||||
let settings = PageSettings::default();
|
||||
let ctx = RenderCtx { url: "/x", title: "T", settings: &settings, width: None };
|
||||
let out = Gemtext.render(&doc, &ctx).unwrap();
|
||||
|
|
@ -377,7 +377,7 @@ mod tests {
|
|||
#[test]
|
||||
fn a_card_divider_emits_nothing() {
|
||||
// Pagination is a WML concern; a Gemini client scrolls one document.
|
||||
let doc = parse::markdown("a\n\nb\n");
|
||||
let doc = parse::markdown("a\n\nb\n").unwrap();
|
||||
let settings = PageSettings::default();
|
||||
let ctx = RenderCtx { url: "/x", title: "T", settings: &settings, width: None };
|
||||
let plain = String::from_utf8(Gemtext.render(&doc, &ctx).unwrap().body).unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue