mirror of
https://github.com/rust-lang/mdBook.git
synced 2025-12-27 10:16:09 -05:00
Add a test for unclosed HTML tags
This commit is contained in:
@@ -239,3 +239,25 @@ fn html_blocks() {
|
||||
fn code_block_fenced_with_indent() {
|
||||
BookTest::from_dir("rendering/code_blocks_fenced_with_indent").check_all_main_files();
|
||||
}
|
||||
|
||||
// Unclosed HTML tags.
|
||||
//
|
||||
// Note that the HTML parsing algorithm is much more complicated than what
|
||||
// this is checking.
|
||||
#[test]
|
||||
fn unclosed_html_tags() {
|
||||
BookTest::init(|_| {})
|
||||
.change_file("src/chapter_1.md", "<div>x<span>foo<i>xyz")
|
||||
.run("build", |cmd| {
|
||||
cmd.expect_stderr(str![[r#"
|
||||
INFO Book building has started
|
||||
INFO Running the html backend
|
||||
INFO HTML book written to `[ROOT]/book`
|
||||
|
||||
"#]]);
|
||||
})
|
||||
.check_main_file(
|
||||
"book/chapter_1.html",
|
||||
str!["<div>x<span>foo<i>xyz</i></span></div>"],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user