diff --git a/tests/testsuite/markdown.rs b/tests/testsuite/markdown.rs index 61317e6b..50471826 100644 --- a/tests/testsuite/markdown.rs +++ b/tests/testsuite/markdown.rs @@ -108,3 +108,39 @@ Carrots "##]], ); } + +// Smart punctuation test. +#[test] +fn smart_punctuation() { + BookTest::from_dir("markdown/smart_punctuation") + // Default is off. + .check_main_file( + "book/smart_punctuation.html", + str![[r##" +

Smart Punctuation

+ +"##]], + ) + .run("build", |cmd| { + cmd.env("MDBOOK_OUTPUT__HTML__SMART_PUNCTUATION", "true"); + }) + .check_main_file( + "book/smart_punctuation.html", + str![[r##" +

Smart Punctuation

+ +"##]], + ); +} diff --git a/tests/testsuite/markdown/smart_punctuation/src/SUMMARY.md b/tests/testsuite/markdown/smart_punctuation/src/SUMMARY.md new file mode 100644 index 00000000..7ec259e3 --- /dev/null +++ b/tests/testsuite/markdown/smart_punctuation/src/SUMMARY.md @@ -0,0 +1 @@ +- [Smart Punctuation](smart_punctuation.md) diff --git a/tests/testsuite/markdown/smart_punctuation/src/smart_punctuation.md b/tests/testsuite/markdown/smart_punctuation/src/smart_punctuation.md new file mode 100644 index 00000000..a27f3c32 --- /dev/null +++ b/tests/testsuite/markdown/smart_punctuation/src/smart_punctuation.md @@ -0,0 +1,7 @@ +# Smart Punctuation + +- En dash: -- +- Em dash: --- +- Ellipsis: ... +- Double quote: "quote" +- Single quote: 'quote'