Skip to content

Commit 4417f8c

Browse files
committed
Add a test for unclosed HTML tags
1 parent cc7f8be commit 4417f8c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/testsuite/rendering.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,25 @@ fn html_blocks() {
239239
fn code_block_fenced_with_indent() {
240240
BookTest::from_dir("rendering/code_blocks_fenced_with_indent").check_all_main_files();
241241
}
242+
243+
// Unclosed HTML tags.
244+
//
245+
// Note that the HTML parsing algorithm is much more complicated than what
246+
// this is checking.
247+
#[test]
248+
fn unclosed_html_tags() {
249+
BookTest::init(|_| {})
250+
.change_file("src/chapter_1.md", "<div>x<span>foo<i>xyz")
251+
.run("build", |cmd| {
252+
cmd.expect_stderr(str![[r#"
253+
INFO Book building has started
254+
INFO Running the html backend
255+
INFO HTML book written to `[ROOT]/book`
256+
257+
"#]]);
258+
})
259+
.check_main_file(
260+
"book/chapter_1.html",
261+
str!["<div>x<span>foo<i>xyz</i></span></div>"],
262+
);
263+
}

0 commit comments

Comments
 (0)