rustdoc: Write a blank line after headers

This commit is contained in:
Brian Anderson 2012-01-17 16:30:53 -08:00
parent 637f19965f
commit cf31eca597
1 changed files with 11 additions and 0 deletions

View File

@ -35,6 +35,7 @@ fn write_markdown(
fn write_header(ctxt: ctxt, title: str) {
let hashes = str::from_chars(vec::init_elt('#', ctxt.depth));
ctxt.w.write_line(#fmt("%s %s", hashes, title));
ctxt.w.write_line("");
}
fn subsection(ctxt: ctxt, f: fn&()) {
@ -162,4 +163,14 @@ mod tests {
let markdown = write_markdown_str(doc);
assert str::contains(markdown, "## Module `moo`");
}
#[test]
fn should_leave_blank_line_after_header() {
let source = "mod morp { }";
let ast = parse::from_str(source);
let doc = extract::extract(ast, "");
let markdown = write_markdown_str(doc);
log(error, markdown);
assert str::contains(markdown, "Module `morp`\n");
}
}