//! Tests for special markdown rendering. use crate::prelude::*; // Checks custom header id and classes. #[test] fn custom_header_attributes() { BookTest::from_dir("markdown/custom_header_attributes") .check_main_file("book/custom_header_attributes.html", str![[r##"

Heading Attributes

Heading with classes

Heading with id and classes

"##]]); } // Test for a variety of footnote renderings. #[test] fn footnotes() { BookTest::from_dir("markdown/footnotes") .check_main_file("book/footnotes.html", str![[r##"

Footnote tests

Footnote example1, or with a word2.

There are multiple references to word2.

Footnote without a paragraph3

Footnote with multiple paragraphs4

Footnote name with wacky characters5

Testing when referring to something earlier.6


  1. This is a footnote. ↩2

  2. A longer footnote. With multiple lines. Link to other. With a reference inside.1 ↩2

    1. Item one
      1. Sub-item
    2. Item two
  3. One

    Two

    Three

  4. Testing footnote id with special characters.

  5. This is defined before it is referred to.

"##]]); } // Basic table test. #[test] fn tables() { BookTest::from_dir("markdown/tables").check_main_file( "book/tables.html", str![[r##"

Tables

foobar
bazbim
Backslash in code/
Double back in code//
Pipe in code|
Pipe in code2test | inside
"##]], ); } // Strikethrough test. #[test] fn strikethrough() { BookTest::from_dir("markdown/strikethrough").check_main_file( "book/strikethrough.html", str![[r##"

Strikethrough

strikethrough example

"##]], ); } // Tasklist test. #[test] fn tasklists() { BookTest::from_dir("markdown/tasklists").check_main_file( "book/tasklists.html", str![[r##"

Tasklisks

"##]], ); } // 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

"##]], ); }