From ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 13 Oct 2022 10:40:01 +0200 Subject: Rename crate to `markdown` --- tests/attention.rs | 272 ++--- tests/autolink.rs | 88 +- tests/block_quote.rs | 74 +- tests/character_escape.rs | 32 +- tests/character_reference.rs | 68 +- tests/code_fenced.rs | 96 +- tests/code_indented.rs | 64 +- tests/code_text.rs | 58 +- tests/commonmark.rs | 1308 +++++++++++----------- tests/definition.rs | 164 +-- tests/frontmatter.rs | 28 +- tests/fuzz.rs | 14 +- tests/gfm_autolink_literal.rs | 132 +-- tests/gfm_footnote.rs | 110 +- tests/gfm_strikethrough.rs | 36 +- tests/gfm_table.rs | 134 +-- tests/gfm_tagfilter.rs | 12 +- tests/gfm_task_list_item.rs | 20 +- tests/hard_break_escape.rs | 22 +- tests/hard_break_trailing.rs | 44 +- tests/heading_atx.rs | 76 +- tests/heading_setext.rs | 98 +- tests/html_flow.rs | 306 ++--- tests/html_text.rs | 144 +-- tests/image.rs | 78 +- tests/link_reference.rs | 128 ++- tests/link_resource.rs | 156 +-- tests/list.rs | 196 ++-- tests/math_flow.rs | 86 +- tests/math_text.rs | 60 +- tests/mdx_esm.rs | 66 +- tests/mdx_expression_flow.rs | 68 +- tests/mdx_expression_text.rs | 84 +- tests/mdx_jsx_flow.rs | 44 +- tests/mdx_jsx_text.rs | 280 +++-- tests/mdx_swc.rs | 14 +- tests/misc_bom.rs | 8 +- tests/misc_dangerous_html.rs | 10 +- tests/misc_dangerous_protocol.rs | 66 +- tests/misc_default_line_ending.rs | 18 +- tests/misc_line_ending.rs | 66 +- tests/misc_soft_break.rs | 8 +- tests/misc_tabs.rs | 92 +- tests/misc_url.rs | 40 +- tests/misc_zero.rs | 12 +- tests/test_utils/hast.rs | 6 +- tests/test_utils/hast_util_to_swc.rs | 2 +- tests/test_utils/mdast_util_to_hast.rs | 2 +- tests/test_utils/mdx.rs | 4 +- tests/test_utils/mdx_plugin_recma_document.rs | 2 +- tests/test_utils/mdx_plugin_recma_jsx_rewrite.rs | 2 +- tests/test_utils/swc.rs | 6 +- tests/test_utils/swc_utils.rs | 2 +- tests/text.rs | 10 +- tests/thematic_break.rs | 64 +- tests/xxx_hast_util_to_swc.rs | 2 +- tests/xxx_mdast_util_to_hast.rs | 4 +- tests/xxx_mdx.rs | 2 +- tests/xxx_mdx_plugin_recma_document.rs | 6 +- tests/xxx_mdx_plugin_recma_jsx_rewrite.rs | 6 +- 60 files changed, 2544 insertions(+), 2556 deletions(-) (limited to 'tests') diff --git a/tests/attention.rs b/tests/attention.rs index e627c4d..1eef10d 100644 --- a/tests/attention.rs +++ b/tests/attention.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{Emphasis, Node, Paragraph, Root, Strong, Text}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, CompileOptions, Constructs, Options, ParseOptions, }; @@ -20,265 +20,265 @@ fn attention() -> Result<(), String> { // Rule 1. assert_eq!( - micromark("*foo bar*"), + to_html("*foo bar*"), "

foo bar

", "should support emphasis w/ `*`" ); assert_eq!( - micromark("a * foo bar*"), + to_html("a * foo bar*"), "

a * foo bar*

", "should not support emphasis if the opening is not left flanking (1)" ); assert_eq!( - micromark("a*\"foo\"*"), + to_html("a*\"foo\"*"), "

a*"foo"*

", "should not support emphasis if the opening is not left flanking (2b)" ); assert_eq!( - micromark("* a *"), + to_html("* a *"), "

* a *

", "should not support emphasis unicode whitespace either" ); assert_eq!( - micromark("foo*bar*"), + to_html("foo*bar*"), "

foobar

", "should support intraword emphasis w/ `*` (1)" ); assert_eq!( - micromark("5*6*78"), + to_html("5*6*78"), "

5678

", "should support intraword emphasis w/ `*` (2)" ); // Rule 2. assert_eq!( - micromark("_foo bar_"), + to_html("_foo bar_"), "

foo bar

", "should support emphasis w/ `_`" ); assert_eq!( - micromark("_ foo bar_"), + to_html("_ foo bar_"), "

_ foo bar_

", "should not support emphasis if the opening is followed by whitespace" ); assert_eq!( - micromark("a_\"foo\"_"), + to_html("a_\"foo\"_"), "

a_"foo"_

", "should not support emphasis if the opening is preceded by something else and followed by punctuation" ); assert_eq!( - micromark("foo_bar_"), + to_html("foo_bar_"), "

foo_bar_

", "should not support intraword emphasis (1)" ); assert_eq!( - micromark("5_6_78"), + to_html("5_6_78"), "

5_6_78

", "should not support intraword emphasis (2)" ); assert_eq!( - micromark("пристаням_стремятся_"), + to_html("пристаням_стремятся_"), "

пристаням_стремятся_

", "should not support intraword emphasis (3)" ); assert_eq!( - micromark("aa_\"bb\"_cc"), + to_html("aa_\"bb\"_cc"), "

aa_"bb"_cc

", "should not support emphasis if the opening is right flanking and the closing is left flanking" ); assert_eq!( - micromark("foo-_(bar)_"), + to_html("foo-_(bar)_"), "

foo-(bar)

", "should support emphasis if the opening is both left and right flanking, if it’s preceded by punctuation" ); // Rule 3. assert_eq!( - micromark("_foo*"), + to_html("_foo*"), "

_foo*

", "should not support emphasis if opening and closing markers don’t match" ); assert_eq!( - micromark("*foo bar *"), + to_html("*foo bar *"), "

*foo bar *

", "should not support emphasis w/ `*` if the closing markers are preceded by whitespace" ); assert_eq!( - micromark("*foo bar\n*"), + to_html("*foo bar\n*"), "

*foo bar\n*

", "should not support emphasis w/ `*` if the closing markers are preceded by a line break (also whitespace)" ); assert_eq!( - micromark("*(*foo)"), + to_html("*(*foo)"), "

*(*foo)

", "should not support emphasis w/ `*` if the closing markers are not right flanking" ); assert_eq!( - micromark("*(*foo*)*"), + to_html("*(*foo*)*"), "

(foo)

", "should support nested emphasis" ); // Rule 4. assert_eq!( - micromark("_foo bar _"), + to_html("_foo bar _"), "

_foo bar _

", "should not support emphasis if the closing `_` is preceded by whitespace" ); assert_eq!( - micromark("_(_foo)"), + to_html("_(_foo)"), "

_(_foo)

", "should not support emphasis w/ `_` if the closing markers are not right flanking" ); assert_eq!( - micromark("_(_foo_)_"), + to_html("_(_foo_)_"), "

(foo)

", "should support nested emphasis w/ `_`" ); assert_eq!( - micromark("_foo_bar"), + to_html("_foo_bar"), "

_foo_bar

", "should not support intraword emphasis w/ `_` (1)" ); assert_eq!( - micromark("_пристаням_стремятся"), + to_html("_пристаням_стремятся"), "

_пристаням_стремятся

", "should not support intraword emphasis w/ `_` (2)" ); assert_eq!( - micromark("_foo_bar_baz_"), + to_html("_foo_bar_baz_"), "

foo_bar_baz

", "should not support intraword emphasis w/ `_` (3)" ); assert_eq!( - micromark("_(bar)_."), + to_html("_(bar)_."), "

(bar).

", "should support emphasis if the opening is both left and right flanking, if it’s followed by punctuation" ); // Rule 5. assert_eq!( - micromark("**foo bar**"), + to_html("**foo bar**"), "

foo bar

", "should support strong emphasis" ); assert_eq!( - micromark("** foo bar**"), + to_html("** foo bar**"), "

** foo bar**

", "should not support strong emphasis if the opening is followed by whitespace" ); assert_eq!( - micromark("a**\"foo\"**"), + to_html("a**\"foo\"**"), "

a**"foo"**

", "should not support strong emphasis if the opening is preceded by something else and followed by punctuation" ); assert_eq!( - micromark("foo**bar**"), + to_html("foo**bar**"), "

foobar

", "should support strong intraword emphasis" ); // Rule 6. assert_eq!( - micromark("__foo bar__"), + to_html("__foo bar__"), "

foo bar

", "should support strong emphasis w/ `_`" ); assert_eq!( - micromark("__ foo bar__"), + to_html("__ foo bar__"), "

__ foo bar__

", "should not support strong emphasis if the opening is followed by whitespace" ); assert_eq!( - micromark("__\nfoo bar__"), + to_html("__\nfoo bar__"), "

__\nfoo bar__

", "should not support strong emphasis if the opening is followed by a line ending (also whitespace)" ); assert_eq!( - micromark("a__\"foo\"__"), + to_html("a__\"foo\"__"), "

a__"foo"__

", "should not support strong emphasis if the opening is preceded by something else and followed by punctuation" ); assert_eq!( - micromark("foo__bar__"), + to_html("foo__bar__"), "

foo__bar__

", "should not support strong intraword emphasis w/ `_` (1)" ); assert_eq!( - micromark("5__6__78"), + to_html("5__6__78"), "

5__6__78

", "should not support strong intraword emphasis w/ `_` (2)" ); assert_eq!( - micromark("пристаням__стремятся__"), + to_html("пристаням__стремятся__"), "

пристаням__стремятся__

", "should not support strong intraword emphasis w/ `_` (3)" ); assert_eq!( - micromark("__foo, __bar__, baz__"), + to_html("__foo, __bar__, baz__"), "

foo, bar, baz

", "should support nested strong emphasis" ); assert_eq!( - micromark("foo-__(bar)__"), + to_html("foo-__(bar)__"), "

foo-(bar)

", "should support strong emphasis if the opening is both left and right flanking, if it’s preceded by punctuation" ); // Rule 7. assert_eq!( - micromark("**foo bar **"), + to_html("**foo bar **"), "

**foo bar **

", "should not support strong emphasis w/ `*` if the closing is preceded by whitespace" ); assert_eq!( - micromark("**(**foo)"), + to_html("**(**foo)"), "

**(**foo)

", "should not support strong emphasis w/ `*` if the closing is preceded by punctuation and followed by something else" ); assert_eq!( - micromark("*(**foo**)*"), + to_html("*(**foo**)*"), "

(foo)

", "should support strong emphasis in emphasis" ); assert_eq!( - micromark( + to_html( "**Gomphocarpus (*Gomphocarpus physocarpus*, syn.\n*Asclepias physocarpa*)**" ), "

Gomphocarpus (Gomphocarpus physocarpus, syn.\nAsclepias physocarpa)

", @@ -286,542 +286,542 @@ fn attention() -> Result<(), String> { ); assert_eq!( - micromark("**foo \"*bar*\" foo**"), + to_html("**foo \"*bar*\" foo**"), "

foo "bar" foo

", "should support emphasis in strong emphasis (2)" ); assert_eq!( - micromark("**foo**bar"), + to_html("**foo**bar"), "

foobar

", "should support strong intraword emphasis" ); // Rule 8. assert_eq!( - micromark("__foo bar __"), + to_html("__foo bar __"), "

__foo bar __

", "should not support strong emphasis w/ `_` if the closing is preceded by whitespace" ); assert_eq!( - micromark("__(__foo)"), + to_html("__(__foo)"), "

__(__foo)

", "should not support strong emphasis w/ `_` if the closing is preceded by punctuation and followed by something else" ); assert_eq!( - micromark("_(__foo__)_"), + to_html("_(__foo__)_"), "

(foo)

", "should support strong emphasis w/ `_` in emphasis" ); assert_eq!( - micromark("__foo__bar"), + to_html("__foo__bar"), "

__foo__bar

", "should not support strong intraword emphasis w/ `_` (1)" ); assert_eq!( - micromark("__пристаням__стремятся"), + to_html("__пристаням__стремятся"), "

__пристаням__стремятся

", "should not support strong intraword emphasis w/ `_` (2)" ); assert_eq!( - micromark("__foo__bar__baz__"), + to_html("__foo__bar__baz__"), "

foo__bar__baz

", "should not support strong intraword emphasis w/ `_` (3)" ); assert_eq!( - micromark("__(bar)__."), + to_html("__(bar)__."), "

(bar).

", "should support strong emphasis if the opening is both left and right flanking, if it’s followed by punctuation" ); // Rule 9. assert_eq!( - micromark("*foo [bar](/url)*"), + to_html("*foo [bar](/url)*"), "

foo bar

", "should support content in emphasis" ); assert_eq!( - micromark("*foo\nbar*"), + to_html("*foo\nbar*"), "

foo\nbar

", "should support line endings in emphasis" ); assert_eq!( - micromark("_foo __bar__ baz_"), + to_html("_foo __bar__ baz_"), "

foo bar baz

", "should support nesting emphasis and strong (1)" ); assert_eq!( - micromark("_foo _bar_ baz_"), + to_html("_foo _bar_ baz_"), "

foo bar baz

", "should support nesting emphasis and strong (2)" ); assert_eq!( - micromark("__foo_ bar_"), + to_html("__foo_ bar_"), "

foo bar

", "should support nesting emphasis and strong (3)" ); assert_eq!( - micromark("*foo *bar**"), + to_html("*foo *bar**"), "

foo bar

", "should support nesting emphasis and strong (4)" ); assert_eq!( - micromark("*foo **bar** baz*"), + to_html("*foo **bar** baz*"), "

foo bar baz

", "should support nesting emphasis and strong (5)" ); assert_eq!( - micromark("*foo**bar**baz*"), + to_html("*foo**bar**baz*"), "

foobarbaz

", "should support nesting emphasis and strong (6)" ); assert_eq!( - micromark("*foo**bar*"), + to_html("*foo**bar*"), "

foo**bar

", "should not support adjacent emphasis in certain cases" ); assert_eq!( - micromark("***foo** bar*"), + to_html("***foo** bar*"), "

foo bar

", "complex (1)" ); assert_eq!( - micromark("*foo **bar***"), + to_html("*foo **bar***"), "

foo bar

", "complex (2)" ); assert_eq!( - micromark("*foo**bar***"), + to_html("*foo**bar***"), "

foobar

", "complex (3)" ); assert_eq!( - micromark("foo***bar***baz"), + to_html("foo***bar***baz"), "

foobarbaz

", "complex (a)" ); assert_eq!( - micromark("foo******bar*********baz"), + to_html("foo******bar*********baz"), "

foobar***baz

", "complex (b)" ); assert_eq!( - micromark("*foo **bar *baz* bim** bop*"), + to_html("*foo **bar *baz* bim** bop*"), "

foo bar baz bim bop

", "should support indefinite nesting of emphasis (1)" ); assert_eq!( - micromark("*foo [*bar*](/url)*"), + to_html("*foo [*bar*](/url)*"), "

foo bar

", "should support indefinite nesting of emphasis (2)" ); assert_eq!( - micromark("** is not an empty emphasis"), + to_html("** is not an empty emphasis"), "

** is not an empty emphasis

", "should not support empty emphasis" ); assert_eq!( - micromark("**** is not an empty emphasis"), + to_html("**** is not an empty emphasis"), "

**** is not an empty emphasis

", "should not support empty strong emphasis" ); // Rule 10. assert_eq!( - micromark("**foo [bar](/url)**"), + to_html("**foo [bar](/url)**"), "

foo bar

", "should support content in strong emphasis" ); assert_eq!( - micromark("**foo\nbar**"), + to_html("**foo\nbar**"), "

foo\nbar

", "should support line endings in emphasis" ); assert_eq!( - micromark("__foo _bar_ baz__"), + to_html("__foo _bar_ baz__"), "

foo bar baz

", "should support nesting emphasis and strong (1)" ); assert_eq!( - micromark("__foo __bar__ baz__"), + to_html("__foo __bar__ baz__"), "

foo bar baz

", "should support nesting emphasis and strong (2)" ); assert_eq!( - micromark("____foo__ bar__"), + to_html("____foo__ bar__"), "

foo bar

", "should support nesting emphasis and strong (3)" ); assert_eq!( - micromark("**foo **bar****"), + to_html("**foo **bar****"), "

foo bar

", "should support nesting emphasis and strong (4)" ); assert_eq!( - micromark("**foo *bar* baz**"), + to_html("**foo *bar* baz**"), "

foo bar baz

", "should support nesting emphasis and strong (5)" ); assert_eq!( - micromark("**foo*bar*baz**"), + to_html("**foo*bar*baz**"), "

foobarbaz

", "should support nesting emphasis and strong (6)" ); assert_eq!( - micromark("***foo* bar**"), + to_html("***foo* bar**"), "

foo bar

", "should support nesting emphasis and strong (7)" ); assert_eq!( - micromark("**foo *bar***"), + to_html("**foo *bar***"), "

foo bar

", "should support nesting emphasis and strong (8)" ); assert_eq!( - micromark("**foo *bar **baz**\nbim* bop**"), + to_html("**foo *bar **baz**\nbim* bop**"), "

foo bar baz\nbim bop

", "should support indefinite nesting of emphasis (1)" ); assert_eq!( - micromark("**foo [*bar*](/url)**"), + to_html("**foo [*bar*](/url)**"), "

foo bar

", "should support indefinite nesting of emphasis (2)" ); assert_eq!( - micromark("__ is not an empty emphasis"), + to_html("__ is not an empty emphasis"), "

__ is not an empty emphasis

", "should not support empty emphasis" ); assert_eq!( - micromark("____ is not an empty emphasis"), + to_html("____ is not an empty emphasis"), "

____ is not an empty emphasis

", "should not support empty strong emphasis" ); // Rule 11. assert_eq!( - micromark("foo ***"), + to_html("foo ***"), "

foo ***

", "should not support emphasis around the same marker" ); assert_eq!( - micromark("foo *\\**"), + to_html("foo *\\**"), "

foo *

", "should support emphasis around an escaped marker" ); assert_eq!( - micromark("foo *_*"), + to_html("foo *_*"), "

foo _

", "should support emphasis around the other marker" ); assert_eq!( - micromark("foo *****"), + to_html("foo *****"), "

foo *****

", "should not support strong emphasis around the same marker" ); assert_eq!( - micromark("foo **\\***"), + to_html("foo **\\***"), "

foo *

", "should support strong emphasis around an escaped marker" ); assert_eq!( - micromark("foo **_**"), + to_html("foo **_**"), "

foo _

", "should support strong emphasis around the other marker" ); assert_eq!( - micromark("**foo*"), + to_html("**foo*"), "

*foo

", "should support a superfluous marker at the start of emphasis" ); assert_eq!( - micromark("*foo**"), + to_html("*foo**"), "

foo*

", "should support a superfluous marker at the end of emphasis" ); assert_eq!( - micromark("***foo**"), + to_html("***foo**"), "

*foo

", "should support a superfluous marker at the start of strong" ); assert_eq!( - micromark("****foo*"), + to_html("****foo*"), "

***foo

", "should support multiple superfluous markers at the start of strong" ); assert_eq!( - micromark("**foo***"), + to_html("**foo***"), "

foo*

", "should support a superfluous marker at the end of strong" ); assert_eq!( - micromark("*foo****"), + to_html("*foo****"), "

foo***

", "should support multiple superfluous markers at the end of strong" ); // Rule 12. assert_eq!( - micromark("foo ___"), + to_html("foo ___"), "

foo ___

", "should not support emphasis around the same marker" ); assert_eq!( - micromark("foo _\\__"), + to_html("foo _\\__"), "

foo _

", "should support emphasis around an escaped marker" ); assert_eq!( - micromark("foo _X_"), + to_html("foo _X_"), "

foo X

", "should support emphasis around the other marker" ); assert_eq!( - micromark("foo _____"), + to_html("foo _____"), "

foo _____

", "should not support strong emphasis around the same marker" ); assert_eq!( - micromark("foo __\\___"), + to_html("foo __\\___"), "

foo _

", "should support strong emphasis around an escaped marker" ); assert_eq!( - micromark("foo __X__"), + to_html("foo __X__"), "

foo X

", "should support strong emphasis around the other marker" ); assert_eq!( - micromark("__foo_"), + to_html("__foo_"), "

_foo

", "should support a superfluous marker at the start of emphasis" ); assert_eq!( - micromark("_foo__"), + to_html("_foo__"), "

foo_

", "should support a superfluous marker at the end of emphasis" ); assert_eq!( - micromark("___foo__"), + to_html("___foo__"), "

_foo

", "should support a superfluous marker at the start of strong" ); assert_eq!( - micromark("____foo_"), + to_html("____foo_"), "

___foo

", "should support multiple superfluous markers at the start of strong" ); assert_eq!( - micromark("__foo___"), + to_html("__foo___"), "

foo_

", "should support a superfluous marker at the end of strong" ); assert_eq!( - micromark("_foo____"), + to_html("_foo____"), "

foo___

", "should support multiple superfluous markers at the end of strong" ); // Rule 13. assert_eq!( - micromark("**foo**"), + to_html("**foo**"), "

foo

", "should support strong w/ `*`" ); assert_eq!( - micromark("*_foo_*"), + to_html("*_foo_*"), "

foo

", "should support emphasis directly in emphasis w/ `_` in `*`" ); assert_eq!( - micromark("__foo__"), + to_html("__foo__"), "

foo

", "should support strong w/ `_`" ); assert_eq!( - micromark("_*foo*_"), + to_html("_*foo*_"), "

foo

", "should support emphasis directly in emphasis w/ `*` in `_`" ); assert_eq!( - micromark("****foo****"), + to_html("****foo****"), "

foo

", "should support strong emphasis directly in strong emphasis w/ `*`" ); assert_eq!( - micromark("____foo____"), + to_html("____foo____"), "

foo

", "should support strong emphasis directly in strong emphasis w/ `_`" ); assert_eq!( - micromark("******foo******"), + to_html("******foo******"), "

foo

", "should support indefinite strong emphasis" ); // Rule 14. assert_eq!( - micromark("***foo***"), + to_html("***foo***"), "

foo

", "should support strong directly in emphasis w/ `*`" ); assert_eq!( - micromark("___foo___"), + to_html("___foo___"), "

foo

", "should support strong directly in emphasis w/ `_`" ); // Rule 15. assert_eq!( - micromark("*foo _bar* baz_"), + to_html("*foo _bar* baz_"), "

foo _bar baz_

", "should not support mismatched emphasis" ); assert_eq!( - micromark("*foo __bar *baz bim__ bam*"), + to_html("*foo __bar *baz bim__ bam*"), "

foo bar *baz bim bam

", "should not support mismatched strong emphasis" ); // Rule 16. assert_eq!( - micromark("**foo **bar baz**"), + to_html("**foo **bar baz**"), "

**foo bar baz

", "should not shortest strong possible" ); assert_eq!( - micromark("*foo *bar baz*"), + to_html("*foo *bar baz*"), "

*foo bar baz

", "should not shortest emphasis possible" ); // Rule 17. assert_eq!( - micromark("*[bar*](/url)"), + to_html("*[bar*](/url)"), "

*bar*

", "should not mismatch inside links (1)" ); assert_eq!( - micromark("_[bar_](/url)"), + to_html("_[bar_](/url)"), "

_bar_

", "should not mismatch inside links (1)" ); assert_eq!( - micromark_with_options("*", &danger)?, + to_html_with_options("*", &danger)?, "

*

", "should not end inside HTML" ); assert_eq!( - micromark_with_options("*", &danger)?, + to_html_with_options("*", &danger)?, "

*

", "should not end emphasis inside HTML" ); assert_eq!( - micromark_with_options("**", &danger)?, + to_html_with_options("**", &danger)?, "

**

", "should not end strong inside HTML (1)" ); assert_eq!( - micromark_with_options("__", &danger)?, + to_html_with_options("__", &danger)?, "

__

", "should not end strong inside HTML (2)" ); assert_eq!( - micromark("*a `*`*"), + to_html("*a `*`*"), "

a *

", "should not end emphasis inside code (1)" ); assert_eq!( - micromark("_a `_`_"), + to_html("_a `_`_"), "

a _

", "should not end emphasis inside code (2)" ); assert_eq!( - micromark("**a"), + to_html("**a"), "

**ahttp://foo.bar/?q=**

", "should not end strong emphasis inside autolinks (1)" ); assert_eq!( - micromark("__a"), + to_html("__a"), "

__ahttp://foo.bar/?q=__

", "should not end strong emphasis inside autolinks (2)" ); assert_eq!( - micromark_with_options( + to_html_with_options( "*a*", &Options { parse: ParseOptions { @@ -839,7 +839,7 @@ fn attention() -> Result<(), String> { ); assert_eq!( - micromark_to_mdast("a *alpha* b **bravo** c.", &ParseOptions::default())?, + to_mdast("a *alpha* b **bravo** c.", &ParseOptions::default())?, Node::Root(Root { children: vec![Node::Paragraph(Paragraph { children: vec![ diff --git a/tests/autolink.rs b/tests/autolink.rs index d2b0956..1b20e08 100644 --- a/tests/autolink.rs +++ b/tests/autolink.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{Link, Node, Paragraph, Root, Text}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, CompileOptions, Constructs, Options, ParseOptions, }; @@ -19,241 +19,241 @@ fn autolink() -> Result<(), String> { }; assert_eq!( - micromark(""), + to_html(""), "

http://foo.bar.baz

", "should support protocol autolinks (1)" ); assert_eq!( - micromark(""), + to_html(""), "

http://foo.bar.baz/test?q=hello&id=22&boolean

", "should support protocol autolinks (2)" ); assert_eq!( - micromark(""), + to_html(""), "

irc://foo.bar:2233/baz

", "should support protocol autolinks w/ non-HTTP schemes" ); assert_eq!( - micromark(""), + to_html(""), "

MAILTO:FOO@BAR.BAZ

", "should support protocol autolinks in uppercase" ); assert_eq!( - micromark(""), + to_html(""), "

a+b+c:d

", "should support protocol autolinks w/ incorrect URIs (1, default)" ); assert_eq!( - micromark_with_options("", &danger)?, + to_html_with_options("", &danger)?, "

a+b+c:d

", "should support protocol autolinks w/ incorrect URIs (1, danger)" ); assert_eq!( - micromark(""), + to_html(""), "

made-up-scheme://foo,bar

", "should support protocol autolinks w/ incorrect URIs (2, default)" ); assert_eq!( - micromark_with_options("", &danger)?, + to_html_with_options("", &danger)?, "

made-up-scheme://foo,bar

", "should support protocol autolinks w/ incorrect URIs (2, danger)" ); assert_eq!( - micromark(""), + to_html(""), "

http://../

", "should support protocol autolinks w/ incorrect URIs (3)" ); assert_eq!( - micromark_with_options("", &danger)?, + to_html_with_options("", &danger)?, "

localhost:5001/foo

", "should support protocol autolinks w/ incorrect URIs (4)" ); assert_eq!( - micromark(""), + to_html(""), "

<http://foo.bar/baz bim>

", "should not support protocol autolinks w/ spaces" ); assert_eq!( - micromark(""), + to_html(""), "

http://example.com/\\[\\

", "should not support character escapes in protocol autolinks" ); assert_eq!( - micromark(""), + to_html(""), "

foo@bar.example.com

", "should support email autolinks (1)" ); assert_eq!( - micromark(""), + to_html(""), "

foo+special@Bar.baz-bar0.com

", "should support email autolinks (2)" ); assert_eq!( - micromark(""), + to_html(""), "

a@b.c

", "should support email autolinks (3)" ); assert_eq!( - micromark(""), + to_html(""), "

<foo+@bar.example.com>

", "should not support character escapes in email autolinks" ); assert_eq!( - micromark("<>"), + to_html("<>"), "

<>

", "should not support empty autolinks" ); assert_eq!( - micromark("< http://foo.bar >"), + to_html("< http://foo.bar >"), "

< http://foo.bar >

", "should not support autolinks w/ space" ); assert_eq!( - micromark(""), + to_html(""), "

<m:abc>

", "should not support autolinks w/ a single character for a scheme" ); assert_eq!( - micromark(""), + to_html(""), "

<foo.bar.baz>

", "should not support autolinks w/o a colon or at sign" ); assert_eq!( - micromark("http://example.com"), + to_html("http://example.com"), "

http://example.com

", "should not support protocol autolinks w/o angle brackets" ); assert_eq!( - micromark("foo@bar.example.com"), + to_html("foo@bar.example.com"), "

foo@bar.example.com

", "should not support email autolinks w/o angle brackets" ); // Extra: assert_eq!( - micromark("<*@example.com>"), + to_html("<*@example.com>"), "

*@example.com

", "should support autolinks w/ atext (1)" ); assert_eq!( - micromark(""), + to_html(""), "

a*@example.com

", "should support autolinks w/ atext (2)" ); assert_eq!( - micromark(""), + to_html(""), "

aa*@example.com

", "should support autolinks w/ atext (3)" ); assert_eq!( - micromark(""), + to_html(""), "

<aaa©@example.com>

", "should support non-atext in email autolinks local part (1)" ); assert_eq!( - micromark(""), + to_html(""), "

<a*a©@example.com>

", "should support non-atext in email autolinks local part (2)" ); assert_eq!( - micromark(""), + to_html(""), "

<asd@.example.com>

", "should not support a dot after an at sign in email autolinks" ); assert_eq!( - micromark(""), + to_html(""), "

<asd@e..xample.com>

", "should not support a dot after another dot in email autolinks" ); assert_eq!( - micromark( + to_html( ""), "

asd@012345678901234567890123456789012345678901234567890123456789012

", "should support 63 character in email autolinks domains" ); assert_eq!( - micromark(""), + to_html(""), "

<asd@0123456789012345678901234567890123456789012345678901234567890123>

", "should not support 64 character in email autolinks domains" ); assert_eq!( - micromark( + to_html( ""), "

asd@012345678901234567890123456789012345678901234567890123456789012.a

", "should support a TLD after a 63 character domain in email autolinks" ); assert_eq!( - micromark(""), + to_html(""), "

<asd@0123456789012345678901234567890123456789012345678901234567890123.a>

", "should not support a TLD after a 64 character domain in email autolinks" ); assert_eq!( - micromark( + to_html( ""), "

asd@a.012345678901234567890123456789012345678901234567890123456789012

", "should support a 63 character TLD in email autolinks" ); assert_eq!( - micromark(""), + to_html(""), "

<asd@a.0123456789012345678901234567890123456789012345678901234567890123>

", "should not support a 64 character TLD in email autolinks" ); assert_eq!( - micromark(""), + to_html(""), "

<asd@-example.com>

", "should not support a dash after `@` in email autolinks" ); assert_eq!( - micromark(""), + to_html(""), "

asd@e-xample.com

", "should support a dash after other domain characters in email autolinks" ); assert_eq!( - micromark(""), + to_html(""), "

asd@e--xample.com

", "should support a dash after another dash in email autolinks" ); assert_eq!( - micromark(""), + to_html(""), "

<asd@example-.com>

", "should not support a dash before a dot in email autolinks" ); assert_eq!( - micromark_with_options( + to_html_with_options( "", &Options { parse: ParseOptions { @@ -271,7 +271,7 @@ fn autolink() -> Result<(), String> { ); assert_eq!( - micromark_to_mdast( + to_mdast( "a b c.", &ParseOptions::default() )?, diff --git a/tests/block_quote.rs b/tests/block_quote.rs index 9d967ee..970b82e 100644 --- a/tests/block_quote.rs +++ b/tests/block_quote.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{BlockQuote, Node, Paragraph, Root, Text}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, Constructs, Options, ParseOptions, }; @@ -10,199 +10,199 @@ use pretty_assertions::assert_eq; #[test] fn block_quote() -> Result<(), String> { assert_eq!( - micromark("> # a\n> b\n> c"), + to_html("> # a\n> b\n> c"), "
\n

a

\n

b\nc

\n
", "should support block quotes" ); assert_eq!( - micromark("># a\n>b\n> c"), + to_html("># a\n>b\n> c"), "
\n

a

\n

b\nc

\n
", "should support block quotes w/o space" ); assert_eq!( - micromark(" > # a\n > b\n > c"), + to_html(" > # a\n > b\n > c"), "
\n

a

\n

b\nc

\n
", "should support prefixing block quotes w/ spaces" ); assert_eq!( - micromark(" > # a\n > b\n > c"), + to_html(" > # a\n > b\n > c"), "
> # a\n> b\n> c\n
", "should not support block quotes w/ 4 spaces" ); assert_eq!( - micromark("> # a\n> b\nc"), + to_html("> # a\n> b\nc"), "
\n

a

\n

b\nc

\n
", "should support lazy content lines" ); assert_eq!( - micromark("> a\nb\n> c"), + to_html("> a\nb\n> c"), "
\n

a\nb\nc

\n
", "should support lazy content lines inside block quotes" ); assert_eq!( - micromark("> a\n> ---"), + to_html("> a\n> ---"), "
\n

a

\n
", "should support setext headings underlines in block quotes" ); assert_eq!( - micromark("> a\n---"), + to_html("> a\n---"), "
\n

a

\n
\n
", "should not support lazy setext headings underlines in block quotes" ); assert_eq!( - micromark("> - a\n> - b"), + to_html("> - a\n> - b"), "
\n
    \n
  • a
  • \n
  • b
  • \n
\n
", "should support lists in block quotes" ); assert_eq!( - micromark("> - a\n- b"), + to_html("> - a\n- b"), "
\n
    \n
  • a
  • \n
\n
\n
    \n
  • b
  • \n
", "should not support lazy lists in block quotes" ); assert_eq!( - micromark("> a\n b"), + to_html("> a\n b"), "
\n
a\n
\n
\n
b\n
", "should not support lazy indented code in block quotes" ); assert_eq!( - micromark("> ```\na\n```"), + to_html("> ```\na\n```"), "
\n
\n
\n

a

\n
\n", "should not support lazy fenced code in block quotes (1)" ); assert_eq!( - micromark("> a\n```\nb"), + to_html("> a\n```\nb"), "
\n

a

\n
\n
b\n
\n", "should not support lazy fenced code in block quotes (2)" ); assert_eq!( - micromark("> a\n - b"), + to_html("> a\n - b"), "
\n

a\n- b

\n
", "should not support lazy indented code (or lazy list) in block quotes" ); assert_eq!( - micromark("> [\na"), + to_html("> [\na"), "
\n

[\na

\n
", "should support lazy, definition-like lines" ); assert_eq!( - micromark("> [a]: b\nc"), + to_html("> [a]: b\nc"), "
\n

c

\n
", "should support a definition, followed by a lazy paragraph" ); assert_eq!( - micromark(">"), + to_html(">"), "
\n
", "should support empty block quotes (1)" ); assert_eq!( - micromark(">\n> \n> "), + to_html(">\n> \n> "), "
\n
", "should support empty block quotes (2)" ); assert_eq!( - micromark(">\n> a\n> "), + to_html(">\n> a\n> "), "
\n

a

\n
", "should support initial or final lazy empty block quote lines" ); assert_eq!( - micromark("> a\n\n> b"), + to_html("> a\n\n> b"), "
\n

a

\n
\n
\n

b

\n
", "should support adjacent block quotes" ); assert_eq!( - micromark("> a\n> b"), + to_html("> a\n> b"), "
\n

a\nb

\n
", "should support a paragraph in a block quote" ); assert_eq!( - micromark("> a\n>\n> b"), + to_html("> a\n>\n> b"), "
\n

a

\n

b

\n
", "should support adjacent paragraphs in block quotes" ); assert_eq!( - micromark("[a]\n\n> [a]: b"), + to_html("[a]\n\n> [a]: b"), "

a

\n
\n
", "should support a definition in a block quote (1)" ); assert_eq!( - micromark("> [a]: b\n\n[a]"), + to_html("> [a]: b\n\n[a]"), "
\n
\n

a

", "should support a definition in a block quote (2)" ); assert_eq!( - micromark("a\n> b"), + to_html("a\n> b"), "

a

\n
\n

b

\n
", "should support interrupting paragraphs w/ block quotes" ); assert_eq!( - micromark("> a\n***\n> b"), + to_html("> a\n***\n> b"), "
\n

a

\n
\n
\n
\n

b

\n
", "should support interrupting block quotes w/ thematic breaks" ); assert_eq!( - micromark("> a\nb"), + to_html("> a\nb"), "
\n

a\nb

\n
", "should not support interrupting block quotes w/ paragraphs" ); assert_eq!( - micromark("> a\n\nb"), + to_html("> a\n\nb"), "
\n

a

\n
\n

b

", "should support interrupting block quotes w/ blank lines" ); assert_eq!( - micromark("> a\n>\nb"), + to_html("> a\n>\nb"), "
\n

a

\n
\n

b

", "should not support interrupting a blank line in a block quotes w/ paragraphs" ); assert_eq!( - micromark("> > > a\nb"), + to_html("> > > a\nb"), "
\n
\n
\n

a\nb

\n
\n
\n
", "should not support interrupting many block quotes w/ paragraphs (1)" ); assert_eq!( - micromark(">>> a\n> b\n>>c"), + to_html(">>> a\n> b\n>>c"), "
\n
\n
\n

a\nb\nc

\n
\n
\n
", "should not support interrupting many block quotes w/ paragraphs (2)" ); assert_eq!( - micromark("> a\n\n> b"), + to_html("> a\n\n> b"), "
\n
a\n
\n
\n
\n

b

\n
", "should support 5 spaces for indented code, not 4" ); assert_eq!( - micromark_with_options( + to_html_with_options( "> # a\n> b\n> c", &Options { parse: ParseOptions { @@ -220,7 +220,7 @@ fn block_quote() -> Result<(), String> { ); assert_eq!( - micromark_to_mdast("> a", &ParseOptions::default())?, + to_mdast("> a", &ParseOptions::default())?, Node::Root(Root { children: vec![Node::BlockQuote(BlockQuote { children: vec![Node::Paragraph(Paragraph { diff --git a/tests/character_escape.rs b/tests/character_escape.rs index c5c9004..0546269 100644 --- a/tests/character_escape.rs +++ b/tests/character_escape.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{Node, Paragraph, Root, Text}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, CompileOptions, Constructs, Options, ParseOptions, }; @@ -19,75 +19,75 @@ fn character_escape() -> Result<(), String> { }; assert_eq!( - micromark( + to_html( "\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\`\\{\\|\\}\\~"), "

!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~

", "should support escaped ascii punctuation" ); assert_eq!( - micromark("\\→\\A\\a\\ \\3\\φ\\«"), + to_html("\\→\\A\\a\\ \\3\\φ\\«"), "

\\→\\A\\a\\ \\3\\φ\\«

", "should not support other characters after a backslash" ); assert_eq!( - micromark( + to_html( "\\*not emphasized*\n\\
not a tag\n\\[not a link](/foo)\n\\`not code`\n1\\. not a list\n\\* not a list\n\\# not a heading\n\\[foo]: /url \"not a reference\"\n\\ö not a character entity"), "

*not emphasized*\n<br/> not a tag\n[not a link](/foo)\n`not code`\n1. not a list\n* not a list\n# not a heading\n[foo]: /url "not a reference"\n&ouml; not a character entity

", "should escape other constructs" ); assert_eq!( - micromark("foo\\\nbar"), + to_html("foo\\\nbar"), "

foo
\nbar

", "should escape a line break" ); assert_eq!( - micromark("`` \\[\\` ``"), + to_html("`` \\[\\` ``"), "

\\[\\`

", "should not escape in text code" ); assert_eq!( - micromark(" \\[\\]"), + to_html(" \\[\\]"), "
\\[\\]\n
", "should not escape in indented code" ); assert_eq!( - micromark(""), + to_html(""), "

http://example.com?find=\\*

", "should not escape in autolink" ); assert_eq!( - micromark_with_options("", &danger)?, + to_html_with_options("", &danger)?, "", "should not escape in flow html" ); assert_eq!( - micromark("[foo](/bar\\* \"ti\\*tle\")"), + to_html("[foo](/bar\\* \"ti\\*tle\")"), "

foo

", "should escape in resource and title" ); assert_eq!( - micromark("[foo]: /bar\\* \"ti\\*tle\"\n\n[foo]"), + to_html("[foo]: /bar\\* \"ti\\*tle\"\n\n[foo]"), "

foo

", "should escape in definition resource and title" ); assert_eq!( - micromark("``` foo\\+bar\nfoo\n```"), + to_html("``` foo\\+bar\nfoo\n```"), "
foo\n
", "should escape in fenced code info" ); assert_eq!( - micromark_with_options( + to_html_with_options( "\\> a", &Options { parse: ParseOptions { @@ -105,7 +105,7 @@ fn character_escape() -> Result<(), String> { ); assert_eq!( - micromark_to_mdast("a \\* b", &ParseOptions::default())?, + to_mdast("a \\* b", &ParseOptions::default())?, Node::Root(Root { children: vec![Node::Paragraph(Paragraph { children: vec![Node::Text(Text { diff --git a/tests/character_reference.rs b/tests/character_reference.rs index 4e9a436..2d5c6df 100644 --- a/tests/character_reference.rs +++ b/tests/character_reference.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{Node, Paragraph, Root, Text}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, CompileOptions, Constructs, Options, ParseOptions, }; @@ -10,7 +10,7 @@ use pretty_assertions::assert_eq; #[test] fn character_reference() -> Result<(), String> { assert_eq!( - micromark( + to_html( "  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸" ), "

\u{a0} & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸

", @@ -18,38 +18,38 @@ fn character_reference() -> Result<(), String> { ); assert_eq!( - micromark("# Ӓ Ϡ �"), + to_html("# Ӓ Ϡ �"), "

# Ӓ Ϡ �

", "should support decimal character references" ); assert_eq!( - micromark("" ആ ಫ"), + to_html("" ആ ಫ"), "

" ആ ಫ

", "should support hexadecimal character references" ); assert_eq!( - micromark( + to_html( "  &x; &#; &#x;\n�\n&#abcdef0;\n&ThisIsNotDefined; &hi?;"), "

&nbsp &x; &#; &#x;\n&#987654321;\n&#abcdef0;\n&ThisIsNotDefined; &hi?;

", "should not support other things that look like character references" ); assert_eq!( - micromark("©"), + to_html("©"), "

&copy

", "should not support character references w/o semicolon" ); assert_eq!( - micromark("&MadeUpEntity;"), + to_html("&MadeUpEntity;"), "

&MadeUpEntity;

", "should not support unknown named character references" ); assert_eq!( - micromark_with_options( + to_html_with_options( "", &Options { compile: CompileOptions { @@ -65,140 +65,140 @@ fn character_reference() -> Result<(), String> { ); assert_eq!( - micromark("[foo](/föö \"föö\")"), + to_html("[foo](/föö \"föö\")"), "

foo

", "should support character references in resource URLs and titles" ); assert_eq!( - micromark("[foo]: /föö \"föö\"\n\n[foo]"), + to_html("[foo]: /föö \"föö\"\n\n[foo]"), "

foo

", "should support character references in definition URLs and titles" ); assert_eq!( - micromark("``` föö\nfoo\n```"), + to_html("``` föö\nfoo\n```"), "
foo\n
", "should support character references in code language" ); assert_eq!( - micromark("`föö`"), + to_html("`föö`"), "

f&ouml;&ouml;

", "should not support character references in text code" ); assert_eq!( - micromark(" föfö"), + to_html(" föfö"), "
f&ouml;f&ouml;\n
", "should not support character references in indented code" ); assert_eq!( - micromark("*foo*\n*foo*"), + to_html("*foo*\n*foo*"), "

*foo*\nfoo

", "should not support character references as construct markers (1)" ); assert_eq!( - micromark("* foo\n\n* foo"), + to_html("* foo\n\n* foo"), "

* foo

\n
    \n
  • foo
  • \n
", "should not support character references as construct markers (2)" ); assert_eq!( - micromark("[a](url "tit")"), + to_html("[a](url "tit")"), "

[a](url "tit")

", "should not support character references as construct markers (3)" ); assert_eq!( - micromark("foo bar"), + to_html("foo bar"), "

foo\n\nbar

", "should not support character references as whitespace (1)" ); assert_eq!( - micromark(" foo"), + to_html(" foo"), "

\tfoo

", "should not support character references as whitespace (2)" ); // Extra: assert_eq!( - micromark("∳"), + to_html("∳"), "

", "should support the longest possible named character reference" ); assert_eq!( - micromark("�"), + to_html("�"), "

", "should “support” a longest possible hexadecimal character reference" ); assert_eq!( - micromark("�"), + to_html("�"), "

", "should “support” a longest possible decimal character reference" ); assert_eq!( - micromark("&CounterClockwiseContourIntegrali;"), + to_html("&CounterClockwiseContourIntegrali;"), "

&CounterClockwiseContourIntegrali;

", "should not support the longest possible named character reference" ); assert_eq!( - micromark("�"), + to_html("�"), "

&#xff99999;

", "should not support a longest possible hexadecimal character reference" ); assert_eq!( - micromark("�"), + to_html("�"), "

&#99999999;

", "should not support a longest possible decimal character reference" ); assert_eq!( - micromark("&-;"), + to_html("&-;"), "

&-;

", "should not support the other characters after `&`" ); assert_eq!( - micromark("&#-;"), + to_html("&#-;"), "

&#-;

", "should not support the other characters after `#`" ); assert_eq!( - micromark("&#x-;"), + to_html("&#x-;"), "

&#x-;

", "should not support the other characters after `#x`" ); assert_eq!( - micromark("<-;"), + to_html("<-;"), "

&lt-;

", "should not support the other characters inside a name" ); assert_eq!( - micromark(" -;"), + to_html(" -;"), "

&#9-;

", "should not support the other characters inside a demical" ); assert_eq!( - micromark(" -;"), + to_html(" -;"), "

&#x9-;

", "should not support the other characters inside a hexademical" ); assert_eq!( - micromark_with_options( + to_html_with_options( "&", &Options { parse: ParseOptions { @@ -216,7 +216,7 @@ fn character_reference() -> Result<(), String> { ); assert_eq!( - micromark_to_mdast("  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸", &ParseOptions::default())?, + to_mdast("  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸", &ParseOptions::default())?, Node::Root(Root { children: vec![Node::Paragraph(Paragraph { children: vec![Node::Text(Text { diff --git a/tests/code_fenced.rs b/tests/code_fenced.rs index c41bd43..c064179 100644 --- a/tests/code_fenced.rs +++ b/tests/code_fenced.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{Code, Node, Root}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, Constructs, Options, ParseOptions, }; @@ -10,260 +10,260 @@ use pretty_assertions::assert_eq; #[test] fn code_fenced() -> Result<(), String> { assert_eq!( - micromark("```\n<\n >\n```"), + to_html("```\n<\n >\n```"), "
<\n >\n
", "should support fenced code w/ grave accents" ); assert_eq!( - micromark("~~~\n<\n >\n~~~"), + to_html("~~~\n<\n >\n~~~"), "
<\n >\n
", "should support fenced code w/ tildes" ); assert_eq!( - micromark("``\nfoo\n``"), + to_html("``\nfoo\n``"), "

foo

", "should not support fenced code w/ less than three markers" ); assert_eq!( - micromark("```\naaa\n~~~\n```"), + to_html("```\naaa\n~~~\n```"), "
aaa\n~~~\n
", "should not support a tilde closing sequence for a grave accent opening sequence" ); assert_eq!( - micromark("~~~\naaa\n```\n~~~"), + to_html("~~~\naaa\n```\n~~~"), "
aaa\n```\n
", "should not support a grave accent closing sequence for a tilde opening sequence" ); assert_eq!( - micromark("````\naaa\n```\n``````"), + to_html("````\naaa\n```\n``````"), "
aaa\n```\n
", "should support a closing sequence longer, but not shorter than, the opening" ); assert_eq!( - micromark("~~~~\naaa\n~~~\n~~~~"), + to_html("~~~~\naaa\n~~~\n~~~~"), "
aaa\n~~~\n
", "should support a closing sequence equal to, but not shorter than, the opening" ); assert_eq!( - micromark("```"), + to_html("```"), "
\n", "should support an eof right after an opening sequence" ); assert_eq!( - micromark("`````\n\n```\naaa\n"), + to_html("`````\n\n```\naaa\n"), "
\n```\naaa\n
\n", "should support an eof somewhere in content" ); assert_eq!( - micromark("> ```\n> aaa\n\nbbb"), + to_html("> ```\n> aaa\n\nbbb"), "
\n
aaa\n
\n
\n

bbb

", "should support no closing sequence in a block quote" ); assert_eq!( - micromark("```\n\n \n```"), + to_html("```\n\n \n```"), "
\n  \n
", "should support blank lines in fenced code" ); assert_eq!( - micromark("```\n```"), + to_html("```\n```"), "
", "should support empty fenced code" ); assert_eq!( - micromark(" ```\n aaa\naaa\n```"), + to_html(" ```\n aaa\naaa\n```"), "
aaa\naaa\n
", "should remove up to one space from the content if the opening sequence is indented w/ 1 space" ); assert_eq!( - micromark(" ```\naaa\n aaa\naaa\n ```"), + to_html(" ```\naaa\n aaa\naaa\n ```"), "
aaa\naaa\naaa\n
", "should remove up to two space from the content if the opening sequence is indented w/ 2 spaces" ); assert_eq!( - micromark(" ```\n aaa\n aaa\n aaa\n ```"), + to_html(" ```\n aaa\n aaa\n aaa\n ```"), "
aaa\n aaa\naaa\n
", "should remove up to three space from the content if the opening sequence is indented w/ 3 spaces" ); assert_eq!( - micromark(" ```\n aaa\n ```"), + to_html(" ```\n aaa\n ```"), "
```\naaa\n```\n
", "should not support indenteding the opening sequence w/ 4 spaces" ); assert_eq!( - micromark("```\naaa\n ```"), + to_html("```\naaa\n ```"), "
aaa\n
", "should support an indented closing sequence" ); assert_eq!( - micromark(" ```\naaa\n ```"), + to_html(" ```\naaa\n ```"), "
aaa\n
", "should support a differently indented closing sequence than the opening sequence" ); assert_eq!( - micromark("```\naaa\n ```\n"), + to_html("```\naaa\n ```\n"), "
aaa\n    ```\n
\n", "should not support an indented closing sequence w/ 4 spaces" ); assert_eq!( - micromark("``` ```\naaa"), + to_html("``` ```\naaa"), "

\naaa

", "should not support grave accents in the opening fence after the opening sequence" ); assert_eq!( - micromark("~~~~~~\naaa\n~~~ ~~\n"), + to_html("~~~~~~\naaa\n~~~ ~~\n"), "
aaa\n~~~ ~~\n
\n", "should not support spaces in the closing sequence" ); assert_eq!( - micromark("foo\n```\nbar\n```\nbaz"), + to_html("foo\n```\nbar\n```\nbaz"), "

foo

\n
bar\n
\n

baz

", "should support interrupting paragraphs" ); assert_eq!( - micromark("foo\n---\n~~~\nbar\n~~~\n# baz"), + to_html("foo\n---\n~~~\nbar\n~~~\n# baz"), "

foo

\n
bar\n
\n

baz

", "should support interrupting other content" ); assert_eq!( - micromark("```ruby\ndef foo(x)\n return 3\nend\n```"), + to_html("```ruby\ndef foo(x)\n return 3\nend\n```"), "
def foo(x)\n  return 3\nend\n
", "should support the info string as a `language-` class (1)" ); assert_eq!( - micromark("````;\n````"), + to_html("````;\n````"), "
", "should support the info string as a `language-` class (2)" ); assert_eq!( - micromark("~~~~ ruby startline=3 $%@#$\ndef foo(x)\n return 3\nend\n~~~~~~~"), + to_html("~~~~ ruby startline=3 $%@#$\ndef foo(x)\n return 3\nend\n~~~~~~~"), "
def foo(x)\n  return 3\nend\n
", "should support the info string as a `language-` class, but not the meta string" ); assert_eq!( - micromark("``` aa ```\nfoo"), + to_html("``` aa ```\nfoo"), "

aa\nfoo

", "should not support grave accents in the meta string" ); assert_eq!( - micromark("~~~ aa ``` ~~~\nfoo\n~~~"), + to_html("~~~ aa ``` ~~~\nfoo\n~~~"), "
foo\n
", "should support grave accents and tildes in the meta string of tilde fenced code" ); assert_eq!( - micromark("```\n``` aaa\n```"), + to_html("```\n``` aaa\n```"), "
``` aaa\n
", "should not support info string on closing sequences" ); // Our own: assert_eq!( - micromark("``` "), + to_html("``` "), "
\n", "should support an eof after whitespace, after the start fence sequence" ); assert_eq!( - micromark("``` js\nalert(1)\n```"), + to_html("``` js\nalert(1)\n```"), "
alert(1)\n
", "should support whitespace between the sequence and the info string" ); assert_eq!( - micromark("```js"), + to_html("```js"), "
\n", "should support an eof after the info string" ); assert_eq!( - micromark("``` js \nalert(1)\n```"), + to_html("``` js \nalert(1)\n```"), "
alert(1)\n
", "should support whitespace after the info string" ); assert_eq!( - micromark("```\n "), + to_html("```\n "), "
  \n
\n", "should support an eof after whitespace in content" ); assert_eq!( - micromark(" ```\n "), + to_html(" ```\n "), "
\n", "should support an eof in the prefix, in content" ); assert_eq!( - micromark("```j\\+s©"), + to_html("```j\\+s©"), "
\n", "should support character escapes and character references in info strings" ); assert_eq!( - micromark("```a\\&b\0c"), + to_html("```a\\&b\0c"), "
\n", "should encode dangerous characters in languages" ); assert_eq!( - micromark(" ```\naaa\n ```"), + to_html(" ```\naaa\n ```"), "
aaa\n ```\n
\n", "should not support a closing sequence w/ too much indent, regardless of opening sequence (1)" ); assert_eq!( - micromark("> ```\n>\n>\n>\n\na"), + to_html("> ```\n>\n>\n>\n\na"), "
\n
\n\n\n
\n
\n

a

", "should not support a closing sequence w/ too much indent, regardless of opening sequence (2)" ); assert_eq!( - micromark("> ```a\nb"), + to_html("> ```a\nb"), "
\n
\n
\n

b

", "should not support lazyness (1)" ); assert_eq!( - micromark("> a\n```b"), + to_html("> a\n```b"), "
\n

a

\n
\n
\n", "should not support lazyness (2)" ); assert_eq!( - micromark("> ```a\n```"), + to_html("> ```a\n```"), "
\n
\n
\n
\n", "should not support lazyness (3)" ); assert_eq!( - micromark_with_options( + to_html_with_options( "```", &Options { parse: ParseOptions { @@ -281,7 +281,7 @@ fn code_fenced() -> Result<(), String> { ); assert_eq!( - micromark_to_mdast( + to_mdast( "```js extra\nconsole.log(1)\nconsole.log(2)\n```", &ParseOptions::default() )?, @@ -298,7 +298,7 @@ fn code_fenced() -> Result<(), String> { ); assert_eq!( - micromark_to_mdast("```\nasd", &ParseOptions::default())?, + to_mdast("```\nasd", &ParseOptions::default())?, Node::Root(Root { children: vec![Node::Code(Code { lang: None, diff --git a/tests/code_indented.rs b/tests/code_indented.rs index b02b092..6545ed6 100644 --- a/tests/code_indented.rs +++ b/tests/code_indented.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{Code, Node, Root}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, CompileOptions, Constructs, Options, ParseOptions, }; @@ -10,115 +10,115 @@ use pretty_assertions::assert_eq; #[test] fn code_indented() -> Result<(), String> { assert_eq!( - micromark(" a simple\n indented code block"), + to_html(" a simple\n indented code block"), "
a simple\n  indented code block\n
", "should support indented code" ); assert_eq!( - micromark(" - foo\n\n bar"), + to_html(" - foo\n\n bar"), "
    \n
  • \n

    foo

    \n

    bar

    \n
  • \n
", "should prefer list item content over indented code (1)" ); assert_eq!( - micromark("1. foo\n\n - bar"), + to_html("1. foo\n\n - bar"), "
    \n
  1. \n

    foo

    \n
      \n
    • bar
    • \n
    \n
  2. \n
", "should prefer list item content over indented code (2)" ); assert_eq!( - micromark(" \n *hi*\n\n - one"), + to_html(" \n *hi*\n\n - one"), "
<a/>\n*hi*\n\n- one\n
", "should support blank lines in indented code (1)" ); assert_eq!( - micromark(" chunk1\n\n chunk2\n \n \n \n chunk3"), + to_html(" chunk1\n\n chunk2\n \n \n \n chunk3"), "
chunk1\n\nchunk2\n\n\n\nchunk3\n
", "should support blank lines in indented code (2)" ); assert_eq!( - micromark(" chunk1\n \n chunk2"), + to_html(" chunk1\n \n chunk2"), "
chunk1\n  \n  chunk2\n
", "should support blank lines in indented code (3)" ); assert_eq!( - micromark("Foo\n bar"), + to_html("Foo\n bar"), "

Foo\nbar

", "should not support interrupting paragraphs" ); assert_eq!( - micromark(" foo\nbar"), + to_html(" foo\nbar"), "
foo\n
\n

bar

", "should support paragraphs directly after indented code" ); assert_eq!( - micromark("# Heading\n foo\nHeading\n------\n foo\n----"), + to_html("# Heading\n foo\nHeading\n------\n foo\n----"), "

Heading

\n
foo\n
\n

Heading

\n
foo\n
\n
", "should mix w/ other content" ); assert_eq!( - micromark(" foo\n bar"), + to_html(" foo\n bar"), "
    foo\nbar\n
", "should support extra whitespace on the first line" ); assert_eq!( - micromark("\n \n foo\n "), + to_html("\n \n foo\n "), "
foo\n
", "should not support initial blank lines" ); assert_eq!( - micromark(" foo "), + to_html(" foo "), "
foo  \n
", "should support trailing whitespace" ); assert_eq!( - micromark("> a\nb"), + to_html("> a\nb"), "
\n
a\n
\n
\n

b

", "should not support lazyness (1)" ); assert_eq!( - micromark("> a\n b"), + to_html("> a\n b"), "
\n

a\nb

\n
", "should not support lazyness (2)" ); assert_eq!( - micromark("> a\n b"), + to_html("> a\n b"), "
\n

a\nb

\n
", "should not support lazyness (3)" ); assert_eq!( - micromark("> a\n b"), + to_html("> a\n b"), "
\n

a\nb

\n
", "should not support lazyness (4)" ); assert_eq!( - micromark("> a\n b"), + to_html("> a\n b"), "
\n
a\n
\n
\n
b\n
", "should not support lazyness (5)" ); assert_eq!( - micromark("> a\n b"), + to_html("> a\n b"), "
\n
a\n
\n
\n
 b\n
", "should not support lazyness (6)" ); assert_eq!( - micromark("> a\n b"), + to_html("> a\n b"), "
\n
a\n
\n
\n
  b\n
", "should not support lazyness (7)" ); @@ -135,43 +135,43 @@ fn code_indented() -> Result<(), String> { }; assert_eq!( - micromark_with_options(" a", &off)?, + to_html_with_options(" a", &off)?, "

a

", "should support turning off code (indented, 1)" ); assert_eq!( - micromark_with_options("> a\n b", &off)?, + to_html_with_options("> a\n b", &off)?, "
\n

a\nb

\n
", "should support turning off code (indented, 2)" ); assert_eq!( - micromark_with_options("- a\n b", &off)?, + to_html_with_options("- a\n b", &off)?, "
    \n
  • a\nb
  • \n
", "should support turning off code (indented, 3)" ); assert_eq!( - micromark_with_options("- a\n - b", &off)?, + to_html_with_options("- a\n - b", &off)?, "
    \n
  • a\n
      \n
    • b
    • \n
    \n
  • \n
", "should support turning off code (indented, 4)" ); assert_eq!( - micromark_with_options("- a\n - b", &off)?, + to_html_with_options("- a\n - b", &off)?, "
    \n
  • a\n
      \n
    • b
    • \n
    \n
  • \n
", "should support turning off code (indented, 5)" ); assert_eq!( - micromark_with_options("```\na\n ```", &off)?, + to_html_with_options("```\na\n ```", &off)?, "
a\n
", "should support turning off code (indented, 6)" ); assert_eq!( - micromark_with_options( + to_html_with_options( "a ", &Options { parse: ParseOptions { @@ -192,19 +192,19 @@ fn code_indented() -> Result<(), String> { ); assert_eq!( - micromark_with_options("- Foo\n---", &off)?, + to_html_with_options("- Foo\n---", &off)?, "
    \n
  • Foo
  • \n
\n
", "should support turning off code (indented, 8)" ); assert_eq!( - micromark_with_options("- Foo\n ---", &off)?, + to_html_with_options("- Foo\n ---", &off)?, "
    \n
  • \n

    Foo

    \n
  • \n
", "should support turning off code (indented, 9)" ); assert_eq!( - micromark_to_mdast( + to_mdast( "\tconsole.log(1)\n console.log(2)\n", &ParseOptions::default() )?, diff --git a/tests/code_text.rs b/tests/code_text.rs index 89fa63f..2784398 100644 --- a/tests/code_text.rs +++ b/tests/code_text.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{InlineCode, Node, Paragraph, Root, Text}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, CompileOptions, Constructs, Options, ParseOptions, }; @@ -19,152 +19,152 @@ fn code_text() -> Result<(), String> { }; assert_eq!( - micromark("`foo`"), + to_html("`foo`"), "

foo

", "should support code" ); assert_eq!( - micromark("`` foo ` bar ``"), + to_html("`` foo ` bar ``"), "

foo ` bar

", "should support code w/ more accents" ); assert_eq!( - micromark("` `` `"), + to_html("` `` `"), "

``

", "should support code w/ fences inside, and padding" ); assert_eq!( - micromark("` `` `"), + to_html("` `` `"), "

``

", "should support code w/ extra padding" ); assert_eq!( - micromark("` a`"), + to_html("` a`"), "

a

", "should support code w/ unbalanced padding" ); assert_eq!( - micromark("`\u{a0}b\u{a0}`"), + to_html("`\u{a0}b\u{a0}`"), "

\u{a0}b\u{a0}

", "should support code w/ non-padding whitespace" ); assert_eq!( - micromark("` `\n` `"), + to_html("` `\n` `"), "

\n

", "should support code w/o data" ); assert_eq!( - micromark("``\nfoo\nbar \nbaz\n``"), + to_html("``\nfoo\nbar \nbaz\n``"), "

foo bar baz

", "should support code w/o line endings (1)" ); assert_eq!( - micromark("``\nfoo \n``"), + to_html("``\nfoo \n``"), "

foo

", "should support code w/o line endings (2)" ); assert_eq!( - micromark("`foo bar \nbaz`"), + to_html("`foo bar \nbaz`"), "

foo bar baz

", "should not support whitespace collapsing" ); assert_eq!( - micromark("`foo\\`bar`"), + to_html("`foo\\`bar`"), "

foo\\bar`

", "should not support character escapes" ); assert_eq!( - micromark("``foo`bar``"), + to_html("``foo`bar``"), "

foo`bar

", "should support more accents" ); assert_eq!( - micromark("` foo `` bar `"), + to_html("` foo `` bar `"), "

foo `` bar

", "should support less accents" ); assert_eq!( - micromark("*foo`*`"), + to_html("*foo`*`"), "

*foo*

", "should precede over emphasis" ); assert_eq!( - micromark("[not a `link](/foo`)"), + to_html("[not a `link](/foo`)"), "

[not a link](/foo)

", "should precede over links" ); assert_eq!( - micromark("`
`"), + to_html("``"), "

<a href="">`

", "should have same precedence as HTML (1)" ); assert_eq!( - micromark_with_options("
`", &danger)?, + to_html_with_options("`", &danger)?, "

`

", "should have same precedence as HTML (2)" ); assert_eq!( - micromark("``"), + to_html("``"), "

<http://foo.bar.baz>`

", "should have same precedence as autolinks (1)" ); assert_eq!( - micromark("`"), + to_html("`"), "

http://foo.bar.`baz`

", "should have same precedence as autolinks (2)" ); assert_eq!( - micromark("```foo``"), + to_html("```foo``"), "

```foo``

", "should not support more accents before a fence" ); assert_eq!( - micromark("`foo"), + to_html("`foo"), "

`foo

", "should not support no closing fence (1)" ); assert_eq!( - micromark("`foo``bar``"), + to_html("`foo``bar``"), "

`foobar

", "should not support no closing fence (2)" ); // Extra: assert_eq!( - micromark("`foo\t\tbar`"), + to_html("`foo\t\tbar`"), "

foo\t\tbar

", "should support tabs in code" ); assert_eq!( - micromark("\\``x`"), + to_html("\\``x`"), "

`x

", "should support an escaped initial grave accent" ); assert_eq!( - micromark_with_options( + to_html_with_options( "`a`", &Options { parse: ParseOptions { @@ -182,7 +182,7 @@ fn code_text() -> Result<(), String> { ); assert_eq!( - micromark_to_mdast("a `alpha` b.", &ParseOptions::default())?, + to_mdast("a `alpha` b.", &ParseOptions::default())?, Node::Root(Root { children: vec![Node::Paragraph(Paragraph { children: vec![ diff --git a/tests/commonmark.rs b/tests/commonmark.rs index cc3d69a..7d62016 100644 --- a/tests/commonmark.rs +++ b/tests/commonmark.rs @@ -3,8 +3,8 @@ // > 👉 **Important**: this module is generated by `build.rs`. // > It is generate from the latest CommonMark website. -extern crate micromark; -use micromark::{micromark_with_options, CompileOptions, Options}; +extern crate markdown; +use markdown::{to_html_with_options, CompileOptions, Options}; use pretty_assertions::assert_eq; #[rustfmt::skip] @@ -20,7 +20,7 @@ fn commonmark() -> Result<(), String> { }; assert_eq!( - micromark_with_options( + to_html_with_options( r###" foo baz bim "###, &danger @@ -32,7 +32,7 @@ fn commonmark() -> Result<(), String> { ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" foo baz bim "###, &danger @@ -44,7 +44,7 @@ fn commonmark() -> Result<(), String> { ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" a a ὐ a "###, @@ -58,7 +58,7 @@ fn commonmark() -> Result<(), String> { ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" - foo bar @@ -76,7 +76,7 @@ fn commonmark() -> Result<(), String> { ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo bar @@ -95,7 +95,7 @@ fn commonmark() -> Result<(), String> { ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> foo "###, &danger @@ -109,7 +109,7 @@ fn commonmark() -> Result<(), String> { ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo "###, &danger @@ -125,7 +125,7 @@ fn commonmark() -> Result<(), String> { ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" foo bar "###, @@ -139,7 +139,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" - foo - bar - baz @@ -162,7 +162,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# Foo "###, &danger @@ -173,7 +173,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"* * * "###, &danger @@ -184,7 +184,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ "###, &danger @@ -195,7 +195,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"\ \A\a\ \3\φ\« "###, &danger @@ -206,7 +206,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"\*not emphasized* \
not a tag \[not a link](/foo) @@ -233,7 +233,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"\\*emphasis* "###, &danger @@ -244,7 +244,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo\ bar "###, @@ -257,7 +257,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`` \[\` `` "###, &danger @@ -268,7 +268,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" \[\] "###, &danger @@ -280,7 +280,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"~~~ \[\] ~~~ @@ -294,7 +294,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -305,7 +305,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -316,7 +316,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo](/bar\* "ti\*tle") "###, &danger @@ -327,7 +327,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo] [foo]: /bar\* "ti\*tle" @@ -340,7 +340,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"``` foo\+bar foo ``` @@ -354,7 +354,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"  & © Æ Ď ¾ ℋ ⅆ ∲ ≧̸ @@ -369,7 +369,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# Ӓ Ϡ � "###, &danger @@ -380,7 +380,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"" ആ ಫ "###, &danger @@ -391,7 +391,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"  &x; &#; &#x; � &#abcdef0; @@ -408,7 +408,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"© "###, &danger @@ -419,7 +419,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"&MadeUpEntity; "###, &danger @@ -430,7 +430,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
"###, &danger @@ -441,7 +441,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo](/föö "föö") "###, &danger @@ -452,7 +452,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo] [foo]: /föö "föö" @@ -465,7 +465,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"``` föö foo ``` @@ -479,7 +479,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`föö` "###, &danger @@ -490,7 +490,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" föfö "###, &danger @@ -502,7 +502,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo* *foo* "###, @@ -515,7 +515,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"* foo * foo @@ -531,7 +531,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo bar "###, &danger @@ -544,7 +544,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" foo "###, &danger @@ -555,7 +555,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[a](url "tit") "###, &danger @@ -566,7 +566,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- `one - two` "###, @@ -581,7 +581,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*** --- ___ @@ -596,7 +596,7 @@ ___ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"+++ "###, &danger @@ -607,7 +607,7 @@ ___ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"=== "###, &danger @@ -618,7 +618,7 @@ ___ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"-- ** __ @@ -633,7 +633,7 @@ __

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" *** *** *** @@ -648,7 +648,7 @@ __

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" *** "###, &danger @@ -660,7 +660,7 @@ __

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo *** "###, @@ -673,7 +673,7 @@ __

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_____________________________________ "###, &danger @@ -684,7 +684,7 @@ __

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" - - - "###, &danger @@ -695,7 +695,7 @@ __

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" ** * ** * ** * ** "###, &danger @@ -706,7 +706,7 @@ __

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- - - - "###, &danger @@ -717,7 +717,7 @@ __

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- - - - "###, &danger @@ -728,7 +728,7 @@ __

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_ _ _ _ a a------ @@ -745,7 +745,7 @@ a------ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" *-* "###, &danger @@ -756,7 +756,7 @@ a------ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo *** - bar @@ -775,7 +775,7 @@ a------ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo *** bar @@ -790,7 +790,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo --- bar @@ -804,7 +804,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"* Foo * * * * Bar @@ -823,7 +823,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- Foo - * * * "###, @@ -840,7 +840,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# foo ## foo ### foo @@ -861,7 +861,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"####### foo "###, &danger @@ -872,7 +872,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"#5 bolt #hashtag @@ -886,7 +886,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"\## foo "###, &danger @@ -897,7 +897,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# foo *bar* \*baz\* "###, &danger @@ -908,7 +908,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# foo "###, &danger @@ -919,7 +919,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" ### foo ## foo # foo @@ -934,7 +934,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" # foo "###, &danger @@ -946,7 +946,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo # bar "###, @@ -959,7 +959,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"## foo ## ### bar ### "###, @@ -972,7 +972,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# foo ################################## ##### foo ## "###, @@ -985,7 +985,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"### foo ### "###, &danger @@ -996,7 +996,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"### foo ### b "###, &danger @@ -1007,7 +1007,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# foo# "###, &danger @@ -1018,7 +1018,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"### foo \### ## foo #\## # foo \# @@ -1033,7 +1033,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**** ## foo **** @@ -1048,7 +1048,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo bar # baz Bar foo @@ -1063,7 +1063,7 @@ Bar foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"## # ### ### @@ -1078,7 +1078,7 @@ Bar foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo *bar* ========= @@ -1094,7 +1094,7 @@ Foo *bar* ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo *bar baz* ==== @@ -1108,7 +1108,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" Foo *bar baz* ==== @@ -1122,7 +1122,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo ------------------------- @@ -1138,7 +1138,7 @@ Foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" Foo --- @@ -1158,7 +1158,7 @@ Foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" Foo --- @@ -1178,7 +1178,7 @@ Foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo ---- "###, @@ -1190,7 +1190,7 @@ Foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo --- "###, @@ -1203,7 +1203,7 @@ Foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo = = @@ -1221,7 +1221,7 @@ Foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo ----- "###, @@ -1233,7 +1233,7 @@ Foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo\ ---- "###, @@ -1245,7 +1245,7 @@ Foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`Foo ---- ` @@ -1265,7 +1265,7 @@ of dashes"/> ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> Foo --- "###, @@ -1280,7 +1280,7 @@ of dashes"/> ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> foo bar === @@ -1297,7 +1297,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- Foo --- "###, @@ -1312,7 +1312,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo Bar --- @@ -1326,7 +1326,7 @@ Bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"--- Foo --- @@ -1345,7 +1345,7 @@ Baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" ==== "###, @@ -1357,7 +1357,7 @@ Baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"--- --- "###, @@ -1370,7 +1370,7 @@ Baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo ----- "###, @@ -1385,7 +1385,7 @@ Baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" foo --- "###, @@ -1399,7 +1399,7 @@ Baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> foo ----- "###, @@ -1414,7 +1414,7 @@ Baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"\> foo ------ "###, @@ -1426,7 +1426,7 @@ Baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo bar @@ -1443,7 +1443,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo bar @@ -1462,7 +1462,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo bar * * * @@ -1479,7 +1479,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo bar \--- @@ -1496,7 +1496,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" a simple indented code block "###, @@ -1510,7 +1510,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" - foo bar @@ -1528,7 +1528,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"1. foo - bar @@ -1548,7 +1548,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
*hi* @@ -1566,7 +1566,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" chunk1 chunk2 @@ -1590,7 +1590,7 @@ chunk3 ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" chunk1 chunk2 @@ -1606,7 +1606,7 @@ chunk3 ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo bar @@ -1620,7 +1620,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" foo bar "###, @@ -1634,7 +1634,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# Heading foo Heading @@ -1656,7 +1656,7 @@ Heading ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" foo bar "###, @@ -1670,7 +1670,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" foo @@ -1686,7 +1686,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" foo "###, &danger @@ -1698,7 +1698,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"``` < > @@ -1714,7 +1714,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"~~~ < > @@ -1730,7 +1730,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`` foo `` @@ -1743,7 +1743,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"``` aaa ~~~ @@ -1759,7 +1759,7 @@ aaa ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"~~~ aaa ``` @@ -1775,7 +1775,7 @@ aaa ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"```` aaa ``` @@ -1791,7 +1791,7 @@ aaa ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"~~~~ aaa ~~~ @@ -1807,7 +1807,7 @@ aaa ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"``` "###, &danger @@ -1818,7 +1818,7 @@ aaa ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"````` ``` @@ -1835,7 +1835,7 @@ aaa ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> ``` > aaa @@ -1853,7 +1853,7 @@ bbb ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"``` @@ -1869,7 +1869,7 @@ bbb ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"``` ``` "###, @@ -1881,7 +1881,7 @@ bbb ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" ``` aaa aaa @@ -1897,7 +1897,7 @@ aaa ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" ``` aaa aaa @@ -1915,7 +1915,7 @@ aaa ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" ``` aaa aaa @@ -1933,7 +1933,7 @@ aaa ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" ``` aaa ``` @@ -1949,7 +1949,7 @@ aaa ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"``` aaa ``` @@ -1963,7 +1963,7 @@ aaa ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" ``` aaa ``` @@ -1977,7 +1977,7 @@ aaa ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"``` aaa ``` @@ -1992,7 +1992,7 @@ aaa ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"``` ``` aaa "###, @@ -2005,7 +2005,7 @@ aaa

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"~~~~~~ aaa ~~~ ~~ @@ -2020,7 +2020,7 @@ aaa ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo ``` bar @@ -2038,7 +2038,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo --- ~~~ @@ -2057,7 +2057,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"```ruby def foo(x) return 3 @@ -2075,7 +2075,7 @@ end ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"~~~~ ruby startline=3 $%@#$ def foo(x) return 3 @@ -2093,7 +2093,7 @@ end ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"````; ```` "###, @@ -2105,7 +2105,7 @@ end ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"``` aa ``` foo "###, @@ -2118,7 +2118,7 @@ foo

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"~~~ aa ``` ~~~ foo ~~~ @@ -2132,7 +2132,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"``` ``` aaa ``` @@ -2146,7 +2146,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
 **Hello**,
@@ -2168,7 +2168,7 @@ _world_.
 );
 
     assert_eq!(
-        micromark_with_options(
+        to_html_with_options(
             r###"
@@ -2194,7 +2194,7 @@ okay. ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" *foo* "###, @@ -2222,7 +2222,7 @@ okay. ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
*Markdown* @@ -2239,7 +2239,7 @@ okay. ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
@@ -2254,7 +2254,7 @@ okay. ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
@@ -2269,7 +2269,7 @@ okay. ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
*foo* @@ -2285,7 +2285,7 @@ okay. ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -2335,7 +2335,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
foo
@@ -2350,7 +2350,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
``` c int x = 33; @@ -2367,7 +2367,7 @@ int x = 33; ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" *bar* @@ -2382,7 +2382,7 @@ int x = 33; ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" *bar* @@ -2397,7 +2397,7 @@ int x = 33; ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" *bar* @@ -2412,7 +2412,7 @@ int x = 33; ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" *bar* "###, @@ -2425,7 +2425,7 @@ int x = 33; ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" *foo* @@ -2440,7 +2440,7 @@ int x = 33; ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" *foo* @@ -2457,7 +2457,7 @@ int x = 33; ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo* "###, &danger @@ -2468,7 +2468,7 @@ int x = 33; ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"

 import Text.HTML.TagSoup
 
@@ -2491,7 +2491,7 @@ main = print $ parseTags tags
 );
 
     assert_eq!(
-        micromark_with_options(
+        to_html_with_options(
             r###"1. *bar*
@@ -2651,7 +2651,7 @@ foo
 );
 
     assert_eq!(
-        micromark_with_options(
+        to_html_with_options(
             r###"
 
     
@@ -2752,7 +2752,7 @@ function matchwo(a,b)
 );
 
     assert_eq!(
-        micromark_with_options(
+        to_html_with_options(
             r###"  
@@ -2767,7 +2767,7 @@ function matchwo(a,b) ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo
bar @@ -2784,7 +2784,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
bar
@@ -2801,7 +2801,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo baz @@ -2816,7 +2816,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
*Emphasized* text. @@ -2833,7 +2833,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
*Emphasized* text.
@@ -2848,7 +2848,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" @@ -2875,7 +2875,7 @@ Hi ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
@@ -2903,7 +2903,7 @@ Hi ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]: /url "title" [foo] @@ -2916,7 +2916,7 @@ Hi ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" [foo]: /url 'the title' @@ -2931,7 +2931,7 @@ Hi ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[Foo*bar\]]:my_(url) 'title (with parens)' [Foo*bar\]] @@ -2944,7 +2944,7 @@ Hi ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[Foo bar]: 'title' @@ -2959,7 +2959,7 @@ Hi ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]: /url ' title line1 @@ -2980,7 +2980,7 @@ line2 ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]: /url 'title with blank line' @@ -2997,7 +2997,7 @@ with blank line' ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]: /url @@ -3011,7 +3011,7 @@ with blank line' ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]: [foo] @@ -3025,7 +3025,7 @@ with blank line' ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]: <> [foo] @@ -3038,7 +3038,7 @@ with blank line' ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]: (baz) [foo] @@ -3052,7 +3052,7 @@ with blank line' ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]: /url\bar\*baz "foo\"bar\baz" [foo] @@ -3065,7 +3065,7 @@ with blank line' ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo] [foo]: url @@ -3078,7 +3078,7 @@ with blank line' ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo] [foo]: first @@ -3092,7 +3092,7 @@ with blank line' ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[FOO]: /url [Foo] @@ -3105,7 +3105,7 @@ with blank line' ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[ΑΓΩ]: /φου [αγω] @@ -3118,7 +3118,7 @@ with blank line' ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]: /url "###, &danger @@ -3128,7 +3128,7 @@ with blank line' ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[ foo ]: /url @@ -3142,7 +3142,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]: /url "title" ok "###, &danger @@ -3153,7 +3153,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]: /url "title" ok "###, @@ -3165,7 +3165,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" [foo]: /url "title" [foo] @@ -3180,7 +3180,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"``` [foo]: /url ``` @@ -3197,7 +3197,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo [bar]: /baz @@ -3213,7 +3213,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# [Foo] [foo]: /url > bar @@ -3229,7 +3229,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]: /url bar === @@ -3244,7 +3244,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]: /url === [foo] @@ -3258,7 +3258,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]: /foo-url "foo" [bar]: /bar-url "bar" @@ -3278,7 +3278,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo] > [foo]: /url @@ -3293,7 +3293,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"aaa bbb @@ -3307,7 +3307,7 @@ bbb ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"aaa bbb @@ -3325,7 +3325,7 @@ ddd

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"aaa @@ -3340,7 +3340,7 @@ bbb ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" aaa bbb "###, @@ -3353,7 +3353,7 @@ bbb

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"aaa bbb ccc @@ -3368,7 +3368,7 @@ ccc

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" aaa bbb "###, @@ -3381,7 +3381,7 @@ bbb

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" aaa bbb "###, @@ -3395,7 +3395,7 @@ bbb ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"aaa bbb "###, @@ -3408,7 +3408,7 @@ bbb

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" aaa @@ -3427,7 +3427,7 @@ aaa ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> # Foo > bar > baz @@ -3444,7 +3444,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"># Foo >bar > baz @@ -3461,7 +3461,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" > # Foo > bar > baz @@ -3478,7 +3478,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" > # Foo > bar > baz @@ -3494,7 +3494,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> # Foo > bar baz @@ -3511,7 +3511,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> bar baz > foo @@ -3528,7 +3528,7 @@ foo

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> foo --- "###, @@ -3543,7 +3543,7 @@ foo

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> - foo - bar "###, @@ -3562,7 +3562,7 @@ foo

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> foo bar "###, @@ -3579,7 +3579,7 @@ foo

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> ``` foo ``` @@ -3596,7 +3596,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> foo - bar "###, @@ -3611,7 +3611,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> "###, &danger @@ -3623,7 +3623,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> > > @@ -3637,7 +3637,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> > foo > @@ -3652,7 +3652,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> foo > bar @@ -3670,7 +3670,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> foo > bar "###, @@ -3685,7 +3685,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> foo > > bar @@ -3701,7 +3701,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo > bar "###, @@ -3716,7 +3716,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> aaa *** > bbb @@ -3735,7 +3735,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> bar baz "###, @@ -3750,7 +3750,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> bar baz @@ -3766,7 +3766,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> bar > baz @@ -3782,7 +3782,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> > > foo bar "###, @@ -3801,7 +3801,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###">>> foo > bar >>baz @@ -3822,7 +3822,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> code > not code @@ -3841,7 +3841,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"A paragraph with two lines. @@ -3863,7 +3863,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"1. A paragraph with two lines. @@ -3889,7 +3889,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- one two @@ -3905,7 +3905,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- one two @@ -3923,7 +3923,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" - one two @@ -3940,7 +3940,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" - one two @@ -3958,7 +3958,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" > > 1. one >> >> two @@ -3980,7 +3980,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###">>- one >> > > two @@ -4000,7 +4000,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"-one 2.two @@ -4014,7 +4014,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo @@ -4033,7 +4033,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"1. foo ``` @@ -4062,7 +4062,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- Foo bar @@ -4087,7 +4087,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"123456789. ok "###, &danger @@ -4100,7 +4100,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"1234567890. not ok "###, &danger @@ -4111,7 +4111,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"0. ok "###, &danger @@ -4124,7 +4124,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"003. ok "###, &danger @@ -4137,7 +4137,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"-1. not ok "###, &danger @@ -4148,7 +4148,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo bar @@ -4167,7 +4167,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" 10. foo bar @@ -4186,7 +4186,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" indented code paragraph @@ -4205,7 +4205,7 @@ paragraph ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"1. indented code paragraph @@ -4228,7 +4228,7 @@ paragraph ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"1. indented code paragraph @@ -4251,7 +4251,7 @@ paragraph ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" foo bar @@ -4265,7 +4265,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo bar @@ -4281,7 +4281,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo bar @@ -4299,7 +4299,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo - @@ -4327,7 +4327,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo "###, @@ -4341,7 +4341,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo @@ -4357,7 +4357,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo - - bar @@ -4374,7 +4374,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo - - bar @@ -4391,7 +4391,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"1. foo 2. 3. bar @@ -4408,7 +4408,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"* "###, &danger @@ -4421,7 +4421,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo * @@ -4439,7 +4439,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" 1. A paragraph with two lines. @@ -4465,7 +4465,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" 1. A paragraph with two lines. @@ -4491,7 +4491,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" 1. A paragraph with two lines. @@ -4517,7 +4517,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" 1. A paragraph with two lines. @@ -4539,7 +4539,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" 1. A paragraph with two lines. @@ -4565,7 +4565,7 @@ with two lines.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" 1. A paragraph with two lines. "###, @@ -4580,7 +4580,7 @@ with two lines. ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> 1. > Blockquote continued here. "###, @@ -4601,7 +4601,7 @@ continued here.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"> 1. > Blockquote > continued here. "###, @@ -4622,7 +4622,7 @@ continued here.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo - bar - baz @@ -4650,7 +4650,7 @@ continued here.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo - bar - baz @@ -4669,7 +4669,7 @@ continued here.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"10) foo - bar "###, @@ -4687,7 +4687,7 @@ continued here.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"10) foo - bar "###, @@ -4704,7 +4704,7 @@ continued here.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- - foo "###, &danger @@ -4721,7 +4721,7 @@ continued here.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"1. - 2. foo "###, &danger @@ -4742,7 +4742,7 @@ continued here.

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- # Foo - Bar --- @@ -4763,7 +4763,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo - bar + baz @@ -4782,7 +4782,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"1. foo 2. bar 3) baz @@ -4801,7 +4801,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo - bar - baz @@ -4818,7 +4818,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"The number of windows in my house is 14. The number of doors is 6. "###, @@ -4831,7 +4831,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"The number of windows in my house is 1. The number of doors is 6. "###, @@ -4846,7 +4846,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo - bar @@ -4872,7 +4872,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo - bar - baz @@ -4901,7 +4901,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo - bar @@ -4926,7 +4926,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- foo notcode @@ -4956,7 +4956,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- a - b - c @@ -4981,7 +4981,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"1. a 2. b @@ -5006,7 +5006,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- a - b - c @@ -5027,7 +5027,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"1. a 2. b @@ -5051,7 +5051,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- a - b @@ -5075,7 +5075,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"* a * @@ -5097,7 +5097,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- a - b @@ -5123,7 +5123,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- a - b @@ -5148,7 +5148,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- a - ``` b @@ -5174,7 +5174,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- a - b @@ -5199,7 +5199,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"* a > b > @@ -5220,7 +5220,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- a > b ``` @@ -5245,7 +5245,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- a "###, &danger @@ -5258,7 +5258,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- a - b "###, @@ -5276,7 +5276,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"1. ``` foo ``` @@ -5297,7 +5297,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"* foo * bar @@ -5319,7 +5319,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"- a - b - c @@ -5351,7 +5351,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`hi`lo` "###, &danger @@ -5362,7 +5362,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`foo` "###, &danger @@ -5373,7 +5373,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`` foo ` bar `` "###, &danger @@ -5384,7 +5384,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"` `` ` "###, &danger @@ -5395,7 +5395,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"` `` ` "###, &danger @@ -5406,7 +5406,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"` a` "###, &danger @@ -5417,7 +5417,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"` b ` "###, &danger @@ -5428,7 +5428,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"` ` ` ` "###, @@ -5441,7 +5441,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`` foo bar @@ -5456,7 +5456,7 @@ baz ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`` foo `` @@ -5469,7 +5469,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`foo bar baz` "###, @@ -5481,7 +5481,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`foo\`bar` "###, &danger @@ -5492,7 +5492,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"``foo`bar`` "###, &danger @@ -5503,7 +5503,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"` foo `` bar ` "###, &danger @@ -5514,7 +5514,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo`*` "###, &danger @@ -5525,7 +5525,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[not a `link](/foo`) "###, &danger @@ -5536,7 +5536,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`` "###, &danger @@ -5547,7 +5547,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"` "###, &danger @@ -5558,7 +5558,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`` "###, &danger @@ -5569,7 +5569,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"` "###, &danger @@ -5580,7 +5580,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"```foo`` "###, &danger @@ -5591,7 +5591,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`foo "###, &danger @@ -5602,7 +5602,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`foo``bar`` "###, &danger @@ -5613,7 +5613,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo bar* "###, &danger @@ -5624,7 +5624,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"a * foo bar* "###, &danger @@ -5635,7 +5635,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"a*"foo"* "###, &danger @@ -5646,7 +5646,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"* a * "###, &danger @@ -5657,7 +5657,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo*bar* "###, &danger @@ -5668,7 +5668,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"5*6*78 "###, &danger @@ -5679,7 +5679,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_foo bar_ "###, &danger @@ -5690,7 +5690,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_ foo bar_ "###, &danger @@ -5701,7 +5701,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"a_"foo"_ "###, &danger @@ -5712,7 +5712,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo_bar_ "###, &danger @@ -5723,7 +5723,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"5_6_78 "###, &danger @@ -5734,7 +5734,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"пристаням_стремятся_ "###, &danger @@ -5745,7 +5745,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"aa_"bb"_cc "###, &danger @@ -5756,7 +5756,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo-_(bar)_ "###, &danger @@ -5767,7 +5767,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_foo* "###, &danger @@ -5778,7 +5778,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo bar * "###, &danger @@ -5789,7 +5789,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo bar * "###, @@ -5802,7 +5802,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*(*foo) "###, &danger @@ -5813,7 +5813,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*(*foo*)* "###, &danger @@ -5824,7 +5824,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo*bar "###, &danger @@ -5835,7 +5835,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_foo bar _ "###, &danger @@ -5846,7 +5846,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_(_foo) "###, &danger @@ -5857,7 +5857,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_(_foo_)_ "###, &danger @@ -5868,7 +5868,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_foo_bar "###, &danger @@ -5879,7 +5879,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_пристаням_стремятся "###, &danger @@ -5890,7 +5890,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_foo_bar_baz_ "###, &danger @@ -5901,7 +5901,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_(bar)_. "###, &danger @@ -5912,7 +5912,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo bar** "###, &danger @@ -5923,7 +5923,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"** foo bar** "###, &danger @@ -5934,7 +5934,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"a**"foo"** "###, &danger @@ -5945,7 +5945,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo**bar** "###, &danger @@ -5956,7 +5956,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__foo bar__ "###, &danger @@ -5967,7 +5967,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__ foo bar__ "###, &danger @@ -5978,7 +5978,7 @@ baz` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__ foo bar__ "###, @@ -5991,7 +5991,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"a__"foo"__ "###, &danger @@ -6002,7 +6002,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo__bar__ "###, &danger @@ -6013,7 +6013,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"5__6__78 "###, &danger @@ -6024,7 +6024,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"пристаням__стремятся__ "###, &danger @@ -6035,7 +6035,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__foo, __bar__, baz__ "###, &danger @@ -6046,7 +6046,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo-__(bar)__ "###, &danger @@ -6057,7 +6057,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo bar ** "###, &danger @@ -6068,7 +6068,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**(**foo) "###, &danger @@ -6079,7 +6079,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*(**foo**)* "###, &danger @@ -6090,7 +6090,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**Gomphocarpus (*Gomphocarpus physocarpus*, syn. *Asclepias physocarpa*)** "###, @@ -6103,7 +6103,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo "*bar*" foo** "###, &danger @@ -6114,7 +6114,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo**bar "###, &danger @@ -6125,7 +6125,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__foo bar __ "###, &danger @@ -6136,7 +6136,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__(__foo) "###, &danger @@ -6147,7 +6147,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_(__foo__)_ "###, &danger @@ -6158,7 +6158,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__foo__bar "###, &danger @@ -6169,7 +6169,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__пристаням__стремятся "###, &danger @@ -6180,7 +6180,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__foo__bar__baz__ "###, &danger @@ -6191,7 +6191,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__(bar)__. "###, &danger @@ -6202,7 +6202,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo [bar](/url)* "###, &danger @@ -6213,7 +6213,7 @@ foo bar__

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo bar* "###, @@ -6226,7 +6226,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_foo __bar__ baz_ "###, &danger @@ -6237,7 +6237,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_foo _bar_ baz_ "###, &danger @@ -6248,7 +6248,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__foo_ bar_ "###, &danger @@ -6259,7 +6259,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo *bar** "###, &danger @@ -6270,7 +6270,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo **bar** baz* "###, &danger @@ -6281,7 +6281,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo**bar**baz* "###, &danger @@ -6292,7 +6292,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo**bar* "###, &danger @@ -6303,7 +6303,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"***foo** bar* "###, &danger @@ -6314,7 +6314,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo **bar*** "###, &danger @@ -6325,7 +6325,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo**bar*** "###, &danger @@ -6336,7 +6336,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo***bar***baz "###, &danger @@ -6347,7 +6347,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo******bar*********baz "###, &danger @@ -6358,7 +6358,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo **bar *baz* bim** bop* "###, &danger @@ -6369,7 +6369,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo [*bar*](/url)* "###, &danger @@ -6380,7 +6380,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"** is not an empty emphasis "###, &danger @@ -6391,7 +6391,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**** is not an empty strong emphasis "###, &danger @@ -6402,7 +6402,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo [bar](/url)** "###, &danger @@ -6413,7 +6413,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo bar** "###, @@ -6426,7 +6426,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__foo _bar_ baz__ "###, &danger @@ -6437,7 +6437,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__foo __bar__ baz__ "###, &danger @@ -6448,7 +6448,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"____foo__ bar__ "###, &danger @@ -6459,7 +6459,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo **bar**** "###, &danger @@ -6470,7 +6470,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo *bar* baz** "###, &danger @@ -6481,7 +6481,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo*bar*baz** "###, &danger @@ -6492,7 +6492,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"***foo* bar** "###, &danger @@ -6503,7 +6503,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo *bar*** "###, &danger @@ -6514,7 +6514,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo *bar **baz** bim* bop** "###, @@ -6527,7 +6527,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo [*bar*](/url)** "###, &danger @@ -6538,7 +6538,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__ is not an empty emphasis "###, &danger @@ -6549,7 +6549,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"____ is not an empty strong emphasis "###, &danger @@ -6560,7 +6560,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo *** "###, &danger @@ -6571,7 +6571,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo *\** "###, &danger @@ -6582,7 +6582,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo *_* "###, &danger @@ -6593,7 +6593,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo ***** "###, &danger @@ -6604,7 +6604,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo **\*** "###, &danger @@ -6615,7 +6615,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo **_** "###, &danger @@ -6626,7 +6626,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo* "###, &danger @@ -6637,7 +6637,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo** "###, &danger @@ -6648,7 +6648,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"***foo** "###, &danger @@ -6659,7 +6659,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"****foo* "###, &danger @@ -6670,7 +6670,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo*** "###, &danger @@ -6681,7 +6681,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo**** "###, &danger @@ -6692,7 +6692,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo ___ "###, &danger @@ -6703,7 +6703,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo _\__ "###, &danger @@ -6714,7 +6714,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo _*_ "###, &danger @@ -6725,7 +6725,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo _____ "###, &danger @@ -6736,7 +6736,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo __\___ "###, &danger @@ -6747,7 +6747,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo __*__ "###, &danger @@ -6758,7 +6758,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__foo_ "###, &danger @@ -6769,7 +6769,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_foo__ "###, &danger @@ -6780,7 +6780,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"___foo__ "###, &danger @@ -6791,7 +6791,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"____foo_ "###, &danger @@ -6802,7 +6802,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__foo___ "###, &danger @@ -6813,7 +6813,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_foo____ "###, &danger @@ -6824,7 +6824,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo** "###, &danger @@ -6835,7 +6835,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*_foo_* "###, &danger @@ -6846,7 +6846,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__foo__ "###, &danger @@ -6857,7 +6857,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_*foo*_ "###, &danger @@ -6868,7 +6868,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"****foo**** "###, &danger @@ -6879,7 +6879,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"____foo____ "###, &danger @@ -6890,7 +6890,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"******foo****** "###, &danger @@ -6901,7 +6901,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"***foo*** "###, &danger @@ -6912,7 +6912,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_____foo_____ "###, &danger @@ -6923,7 +6923,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo _bar* baz_ "###, &danger @@ -6934,7 +6934,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo __bar *baz bim__ bam* "###, &danger @@ -6945,7 +6945,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**foo **bar baz** "###, &danger @@ -6956,7 +6956,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo *bar baz* "###, &danger @@ -6967,7 +6967,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*[bar*](/url) "###, &danger @@ -6978,7 +6978,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_foo [bar_](/url) "###, &danger @@ -6989,7 +6989,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"* "###, &danger @@ -7000,7 +7000,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**
"###, &danger @@ -7011,7 +7011,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__
"###, &danger @@ -7022,7 +7022,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*a `*`* "###, &danger @@ -7033,7 +7033,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"_a `_`_ "###, &danger @@ -7044,7 +7044,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"**a "###, &danger @@ -7055,7 +7055,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"__a "###, &danger @@ -7066,7 +7066,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](/uri "title") "###, &danger @@ -7077,7 +7077,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](/uri) "###, &danger @@ -7088,7 +7088,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[](./target.md) "###, &danger @@ -7099,7 +7099,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link]() "###, &danger @@ -7110,7 +7110,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](<>) "###, &danger @@ -7121,7 +7121,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[]() "###, &danger @@ -7132,7 +7132,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](/my uri) "###, &danger @@ -7143,7 +7143,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](
) "###, &danger @@ -7154,7 +7154,7 @@ bim bop

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](foo bar) "###, @@ -7167,7 +7167,7 @@ bar)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link]() "###, @@ -7180,7 +7180,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[a]() "###, &danger @@ -7191,7 +7191,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link]() "###, &danger @@ -7202,7 +7202,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[a]( [a](c) @@ -7217,7 +7217,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](\(foo\)) "###, &danger @@ -7228,7 +7228,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](foo(and(bar))) "###, &danger @@ -7239,7 +7239,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](foo(and(bar)) "###, &danger @@ -7250,7 +7250,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](foo\(and\(bar\)) "###, &danger @@ -7261,7 +7261,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link]() "###, &danger @@ -7272,7 +7272,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](foo\)\:) "###, &danger @@ -7283,7 +7283,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](#fragment) [link](http://example.com#fragment) @@ -7300,7 +7300,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](foo\bar) "###, &danger @@ -7311,7 +7311,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](foo%20bä) "###, &danger @@ -7322,7 +7322,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link]("title") "###, &danger @@ -7333,7 +7333,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](/url "title") [link](/url 'title') [link](/url (title)) @@ -7348,7 +7348,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](/url "title \""") "###, &danger @@ -7359,7 +7359,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](/url "title") "###, &danger @@ -7370,7 +7370,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](/url "title "and" title") "###, &danger @@ -7381,7 +7381,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link](/url 'title "and" title') "###, &danger @@ -7392,7 +7392,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link]( /uri "title" ) "###, @@ -7404,7 +7404,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link] (/uri) "###, &danger @@ -7415,7 +7415,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link [foo [bar]]](/uri) "###, &danger @@ -7426,7 +7426,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link] bar](/uri) "###, &danger @@ -7437,7 +7437,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link [bar](/uri) "###, &danger @@ -7448,7 +7448,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link \[bar](/uri) "###, &danger @@ -7459,7 +7459,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link *foo **bar** `#`*](/uri) "###, &danger @@ -7470,7 +7470,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[![moon](moon.jpg)](/uri) "###, &danger @@ -7481,7 +7481,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo [bar](/uri)](/uri) "###, &danger @@ -7492,7 +7492,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo *[bar [baz](/uri)](/uri)*](/uri) "###, &danger @@ -7503,7 +7503,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![[[foo](uri1)](uri2)](uri3) "###, &danger @@ -7514,7 +7514,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*[foo*](/uri) "###, &danger @@ -7525,7 +7525,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo *bar](baz*) "###, &danger @@ -7536,7 +7536,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo [bar* baz] "###, &danger @@ -7547,7 +7547,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo "###, &danger @@ -7558,7 +7558,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo`](/uri)` "###, &danger @@ -7569,7 +7569,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo "###, &danger @@ -7580,7 +7580,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo][bar] [bar]: /url "title" @@ -7593,7 +7593,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link [foo [bar]]][ref] [ref]: /uri @@ -7606,7 +7606,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link \[bar][ref] [ref]: /uri @@ -7619,7 +7619,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[link *foo **bar** `#`*][ref] [ref]: /uri @@ -7632,7 +7632,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[![moon](moon.jpg)][ref] [ref]: /uri @@ -7645,7 +7645,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo [bar](/uri)][ref] [ref]: /uri @@ -7658,7 +7658,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo *bar [baz][ref]*][ref] [ref]: /uri @@ -7671,7 +7671,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*[foo*][ref] [ref]: /uri @@ -7684,7 +7684,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo *bar][ref]* [ref]: /uri @@ -7697,7 +7697,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo [ref]: /uri @@ -7710,7 +7710,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo`][ref]` [ref]: /uri @@ -7723,7 +7723,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo [ref]: /uri @@ -7736,7 +7736,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo][BaR] [bar]: /url "title" @@ -7749,7 +7749,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[ẞ] [SS]: /url @@ -7762,7 +7762,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[Foo bar]: /url @@ -7776,7 +7776,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo] [bar] [bar]: /url "title" @@ -7789,7 +7789,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo] [bar] @@ -7804,7 +7804,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]: /url1 [foo]: /url2 @@ -7819,7 +7819,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[bar][foo\!] [foo!]: /url @@ -7832,7 +7832,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo][ref[] [ref[]: /uri @@ -7846,7 +7846,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo][ref[bar]] [ref[bar]]: /uri @@ -7860,7 +7860,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[[[foo]]] [[[foo]]]: /url @@ -7874,7 +7874,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo][ref\[] [ref\[]: /uri @@ -7887,7 +7887,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[bar\\]: /uri [bar\\] @@ -7900,7 +7900,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[] []: /uri @@ -7914,7 +7914,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[ ] @@ -7932,7 +7932,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo][] [foo]: /url "title" @@ -7945,7 +7945,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[*foo* bar][] [*foo* bar]: /url "title" @@ -7958,7 +7958,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[Foo][] [foo]: /url "title" @@ -7971,7 +7971,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo] [] @@ -7986,7 +7986,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo] [foo]: /url "title" @@ -7999,7 +7999,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[*foo* bar] [*foo* bar]: /url "title" @@ -8012,7 +8012,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[[*foo* bar]] [*foo* bar]: /url "title" @@ -8025,7 +8025,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[[bar [foo] [foo]: /url @@ -8038,7 +8038,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[Foo] [foo]: /url "title" @@ -8051,7 +8051,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo] bar [foo]: /url @@ -8064,7 +8064,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"\[foo] [foo]: /url "title" @@ -8077,7 +8077,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo*]: /url *[foo*] @@ -8090,7 +8090,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo][bar] [foo]: /url1 @@ -8104,7 +8104,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo][] [foo]: /url1 @@ -8117,7 +8117,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo]() [foo]: /url1 @@ -8130,7 +8130,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo](not a link) [foo]: /url1 @@ -8143,7 +8143,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo][bar][baz] [baz]: /url @@ -8156,7 +8156,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo][bar][baz] [baz]: /url1 @@ -8170,7 +8170,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[foo][bar][baz] [baz]: /url1 @@ -8184,7 +8184,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![foo](/url "title") "###, &danger @@ -8195,7 +8195,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![foo *bar*] [foo *bar*]: train.jpg "train & tracks" @@ -8208,7 +8208,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![foo ![bar](/url)](/url2) "###, &danger @@ -8219,7 +8219,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![foo [bar](/url)](/url2) "###, &danger @@ -8230,7 +8230,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![foo *bar*][] [foo *bar*]: train.jpg "train & tracks" @@ -8243,7 +8243,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![foo *bar*][foobar] [FOOBAR]: train.jpg "train & tracks" @@ -8256,7 +8256,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![foo](train.jpg) "###, &danger @@ -8267,7 +8267,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"My ![foo bar](/path/to/train.jpg "title" ) "###, &danger @@ -8278,7 +8278,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![foo]() "###, &danger @@ -8289,7 +8289,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![](/url) "###, &danger @@ -8300,7 +8300,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![foo][bar] [bar]: /url @@ -8313,7 +8313,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![foo][bar] [BAR]: /url @@ -8326,7 +8326,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![foo][] [foo]: /url "title" @@ -8339,7 +8339,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![*foo* bar][] [*foo* bar]: /url "title" @@ -8352,7 +8352,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![Foo][] [foo]: /url "title" @@ -8365,7 +8365,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![foo] [] @@ -8380,7 +8380,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![foo] [foo]: /url "title" @@ -8393,7 +8393,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![*foo* bar] [*foo* bar]: /url "title" @@ -8406,7 +8406,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![[foo]] [[foo]]: /url "title" @@ -8420,7 +8420,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"![Foo] [foo]: /url "title" @@ -8433,7 +8433,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"!\[foo] [foo]: /url "title" @@ -8446,7 +8446,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"\![foo] [foo]: /url "title" @@ -8459,7 +8459,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8470,7 +8470,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8481,7 +8481,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8492,7 +8492,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8503,7 +8503,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8514,7 +8514,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8525,7 +8525,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8536,7 +8536,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8547,7 +8547,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8558,7 +8558,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8569,7 +8569,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8580,7 +8580,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8591,7 +8591,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8602,7 +8602,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"<> "###, &danger @@ -8613,7 +8613,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"< http://foo.bar > "###, &danger @@ -8624,7 +8624,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8635,7 +8635,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8646,7 +8646,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"http://example.com "###, &danger @@ -8657,7 +8657,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo@bar.example.com "###, &danger @@ -8668,7 +8668,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
"###, &danger @@ -8679,7 +8679,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
"###, &danger @@ -8690,7 +8690,7 @@ bar>)

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
"###, @@ -8703,7 +8703,7 @@ data="foo" >

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
"###, @@ -8716,7 +8716,7 @@ _boolean zoop:33=zoop:33 />

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo "###, &danger @@ -8727,7 +8727,7 @@ _boolean zoop:33=zoop:33 />

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"<33> <__> "###, &danger @@ -8738,7 +8738,7 @@ _boolean zoop:33=zoop:33 />

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
"###, &danger @@ -8749,7 +8749,7 @@ _boolean zoop:33=zoop:33 />

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"< a>< foo> ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
"###, &danger @@ -8788,7 +8788,7 @@ bim!bop />

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
"###, &danger @@ -8799,7 +8799,7 @@ bim!bop />

); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8810,7 +8810,7 @@ bim!bop />

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo "###, @@ -8823,7 +8823,7 @@ comment - with hyphen -->

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo "###, &danger @@ -8834,7 +8834,7 @@ comment - with hyphen -->

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo foo --> foo @@ -8848,7 +8848,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo "###, &danger @@ -8859,7 +8859,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo "###, &danger @@ -8870,7 +8870,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo &<]]> "###, &danger @@ -8881,7 +8881,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo "###, &danger @@ -8892,7 +8892,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo "###, &danger @@ -8903,7 +8903,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" "###, &danger @@ -8914,7 +8914,7 @@ foo ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo baz "###, @@ -8927,7 +8927,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo\ baz "###, @@ -8940,7 +8940,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo baz "###, @@ -8953,7 +8953,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo bar "###, @@ -8966,7 +8966,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo\ bar "###, @@ -8979,7 +8979,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo bar* "###, @@ -8992,7 +8992,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"*foo\ bar* "###, @@ -9005,7 +9005,7 @@ bar

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`code span` "###, @@ -9017,7 +9017,7 @@ span` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"`code\ span` "###, @@ -9029,7 +9029,7 @@ span` ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
"###, @@ -9042,7 +9042,7 @@ bar">

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"
"###, @@ -9055,7 +9055,7 @@ bar">

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo\ "###, &danger @@ -9066,7 +9066,7 @@ bar">

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo "###, &danger @@ -9077,7 +9077,7 @@ bar">

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"### foo\ "###, &danger @@ -9088,7 +9088,7 @@ bar">

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"### foo "###, &danger @@ -9099,7 +9099,7 @@ bar">

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo baz "###, @@ -9112,7 +9112,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"foo baz "###, @@ -9125,7 +9125,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"hello $.;'there "###, &danger @@ -9136,7 +9136,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Foo χρῆν "###, &danger @@ -9147,7 +9147,7 @@ baz

); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Multiple spaces "###, &danger diff --git a/tests/definition.rs b/tests/definition.rs index 376035a..c6923bc 100644 --- a/tests/definition.rs +++ b/tests/definition.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{Definition, Node, Root}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, CompileOptions, Constructs, Options, ParseOptions, }; @@ -19,473 +19,473 @@ fn definition() -> Result<(), String> { }; assert_eq!( - micromark("[foo]: /url \"title\"\n\n[foo]"), + to_html("[foo]: /url \"title\"\n\n[foo]"), "

foo

", "should support link definitions" ); assert_eq!( - micromark("[foo]:\n\n/url\n\n[foo]"), + to_html("[foo]:\n\n/url\n\n[foo]"), "

[foo]:

\n

/url

\n

[foo]

", "should not support blank lines before destination" ); assert_eq!( - micromark(" [foo]: \n /url \n 'the title' \n\n[foo]"), + to_html(" [foo]: \n /url \n 'the title' \n\n[foo]"), "

foo

", "should support whitespace and line endings in definitions" ); assert_eq!( - micromark("[a]:b 'c'\n\n[a]"), + to_html("[a]:b 'c'\n\n[a]"), "

a

", "should support no whitespace after `:` in definitions" ); assert_eq!( - micromark("[Foo*bar\\]]:my_(url) 'title (with parens)'\n\n[Foo*bar\\]]"), + to_html("[Foo*bar\\]]:my_(url) 'title (with parens)'\n\n[Foo*bar\\]]"), "

Foo*bar]

", "should support complex definitions (1)" ); assert_eq!( - micromark("[Foo bar]:\n\n'title'\n\n[Foo bar]"), + to_html("[Foo bar]:\n\n'title'\n\n[Foo bar]"), "

Foo bar

", "should support complex definitions (2)" ); assert_eq!( - micromark("[foo]: /url '\ntitle\nline1\nline2\n'\n\n[foo]"), + to_html("[foo]: /url '\ntitle\nline1\nline2\n'\n\n[foo]"), "

foo

", "should support line endings in titles" ); assert_eq!( - micromark("[foo]: /url 'title\n\nwith blank line'\n\n[foo]"), + to_html("[foo]: /url 'title\n\nwith blank line'\n\n[foo]"), "

[foo]: /url 'title

\n

with blank line'

\n

[foo]

", "should not support blank lines in titles" ); assert_eq!( - micromark("[foo]:\n/url\n\n[foo]"), + to_html("[foo]:\n/url\n\n[foo]"), "

foo

", "should support definitions w/o title" ); assert_eq!( - micromark("[foo]:\n\n[foo]"), + to_html("[foo]:\n\n[foo]"), "

[foo]:

\n

[foo]

", "should not support definitions w/o destination" ); assert_eq!( - micromark("[foo]: <>\n\n[foo]"), + to_html("[foo]: <>\n\n[foo]"), "

foo

", "should support definitions w/ explicit empty destinations" ); assert_eq!( - micromark_with_options("[foo]: (baz)\n\n[foo]", &danger)?, + to_html_with_options("[foo]: (baz)\n\n[foo]", &danger)?, "

[foo]: (baz)

\n

[foo]

", "should not support definitions w/ no whitespace between destination and title" ); assert_eq!( - micromark("[foo]: /url\\bar\\*baz \"foo\\\"bar\\baz\"\n\n[foo]"), + to_html("[foo]: /url\\bar\\*baz \"foo\\\"bar\\baz\"\n\n[foo]"), "

foo

", "should support character escapes in destinations and titles" ); assert_eq!( - micromark("[foo]\n\n[foo]: url"), + to_html("[foo]\n\n[foo]: url"), "

foo

\n", "should support a link before a definition" ); assert_eq!( - micromark("[foo]: first\n[foo]: second\n\n[foo]"), + to_html("[foo]: first\n[foo]: second\n\n[foo]"), "

foo

", "should match w/ the first definition" ); assert_eq!( - micromark("[FOO]: /url\n\n[Foo]"), + to_html("[FOO]: /url\n\n[Foo]"), "

Foo

", "should match w/ case-insensitive (1)" ); assert_eq!( - micromark("[ΑΓΩ]: /φου\n\n[αγω]"), + to_html("[ΑΓΩ]: /φου\n\n[αγω]"), "

αγω

", "should match w/ case-insensitive (2)" ); assert_eq!( - micromark("[ı]: a\n\n[I]"), + to_html("[ı]: a\n\n[I]"), "

I

", "should match w/ undotted turkish i (1)" ); assert_eq!( - micromark("[I]: a\n\n[ı]"), + to_html("[I]: a\n\n[ı]"), "

ı

", "should match w/ undotted turkish i (2)" ); // Ref: // GFM parses the same (last checked: 2022-07-11). assert_eq!( - micromark("[i]: a\n\n[İ]"), + to_html("[i]: a\n\n[İ]"), "

[İ]

", "should *not* match w/ dotted turkish i (1)" ); // Ref: // GFM parses the same (last checked: 2022-07-11). assert_eq!( - micromark("[İ]: a\n\n[i]"), + to_html("[İ]: a\n\n[i]"), "

[i]

", "should *not* match w/ dotted turkish i (2)" ); assert_eq!( - micromark("[foo]: /url"), + to_html("[foo]: /url"), "", "should not contribute anything w/o reference (1)" ); assert_eq!( - micromark("[\nfoo\n]: /url\nbar"), + to_html("[\nfoo\n]: /url\nbar"), "

bar

", "should not contribute anything w/o reference (2)" ); assert_eq!( - micromark("[foo]: /url \"title\" \n\n[foo]"), + to_html("[foo]: /url \"title\" \n\n[foo]"), "

foo

", "should support whitespace after title" ); assert_eq!( - micromark("[foo]: /url\n\"title\" \n\n[foo]"), + to_html("[foo]: /url\n\"title\" \n\n[foo]"), "

foo

", "should support whitespace after title on a separate line" ); assert_eq!( - micromark("[foo]: /url \"title\" ok"), + to_html("[foo]: /url \"title\" ok"), "

[foo]: /url "title" ok

", "should not support non-whitespace content after definitions (1)" ); assert_eq!( - micromark("[foo]: /url\n\"title\" ok"), + to_html("[foo]: /url\n\"title\" ok"), "

"title" ok

", "should not support non-whitespace content after definitions (2)" ); assert_eq!( - micromark(" [foo]: /url \"title\"\n\n[foo]"), + to_html(" [foo]: /url \"title\"\n\n[foo]"), "
[foo]: /url "title"\n
\n

[foo]

", "should prefer indented code over definitions" ); assert_eq!( - micromark("```\n[foo]: /url\n```\n\n[foo]"), + to_html("```\n[foo]: /url\n```\n\n[foo]"), "
[foo]: /url\n
\n

[foo]

", "should not support definitions in fenced code" ); assert_eq!( - micromark("Foo\n[bar]: /baz\n\n[bar]"), + to_html("Foo\n[bar]: /baz\n\n[bar]"), "

Foo\n[bar]: /baz

\n

[bar]

", "should not support definitions in paragraphs" ); assert_eq!( - micromark("# [Foo]\n[foo]: /url\n> bar"), + to_html("# [Foo]\n[foo]: /url\n> bar"), "

Foo

\n
\n

bar

\n
", "should not support definitions in headings" ); assert_eq!( - micromark("[foo]: /url\nbar\n===\n[foo]"), + to_html("[foo]: /url\nbar\n===\n[foo]"), "

bar

\n

foo

", "should support setext headings after definitions" ); assert_eq!( - micromark("[foo]: /url\n===\n[foo]"), + to_html("[foo]: /url\n===\n[foo]"), "

===\nfoo

", "should not support setext heading underlines after definitions" ); assert_eq!( - micromark( + to_html( "[foo]: /foo-url \"foo\"\n[bar]: /bar-url\n \"bar\"\n[baz]: /baz-url\n\n[foo],\n[bar],\n[baz]"), "

foo,\nbar,\nbaz

", "should support definitions after definitions" ); assert_eq!( - micromark("> [foo]: /url\n\n[foo]"), + to_html("> [foo]: /url\n\n[foo]"), "
\n
\n

foo

", "should support definitions in block quotes (1)" ); assert_eq!( - micromark("> [a]: <> 'b\n> c'"), + to_html("> [a]: <> 'b\n> c'"), "
\n
", "should support definitions in block quotes (2)" ); assert_eq!( - micromark("> [a]\n\n[a]: b (c\n)"), + to_html("> [a]\n\n[a]: b (c\n)"), "
\n

a

\n
\n", "should support definitions in block quotes (3)" ); // Extra assert_eq!( - micromark("[\\[\\+\\]]: example.com\n\nLink: [\\[\\+\\]]."), + to_html("[\\[\\+\\]]: example.com\n\nLink: [\\[\\+\\]]."), "

Link: [+].

", "should match w/ character escapes" ); assert_eq!( - micromark("[x]: \\\" \\(\\)\\\"\n\n[x]"), + to_html("[x]: \\\" \\(\\)\\\"\n\n[x]"), "

x

", "should support character escapes & references in unenclosed destinations" ); assert_eq!( - micromark("[x]: <\\> \\+\\>>\n\n[x]"), + to_html("[x]: <\\> \\+\\>>\n\n[x]"), "

x

", "should support character escapes & references in enclosed destinations" ); assert_eq!( - micromark("[x]: <\n\n[x]"), + to_html("[x]: <\n\n[x]"), "

[x]: <

\n

[x]

", "should not support a line ending at start of enclosed destination" ); assert_eq!( - micromark("[x]: [x]: <x

\n

[x]

", "should not support a line ending in enclosed destination" ); assert_eq!( - micromark("[x]: \u{000b}a\n\n[x]"), + to_html("[x]: \u{000b}a\n\n[x]"), "

[x]: \u{000b}a

\n

[x]

", "should not support ascii control characters at the start of destination" ); assert_eq!( - micromark("[x]: a\u{000b}b\n\n[x]"), + to_html("[x]: a\u{000b}b\n\n[x]"), "

[x]: a\u{000b}b

\n

[x]

", "should not support ascii control characters in destination" ); assert_eq!( - micromark("[x]: <\u{000b}a>\n\n[x]"), + to_html("[x]: <\u{000b}a>\n\n[x]"), "

x

", "should support ascii control characters at the start of enclosed destination" ); assert_eq!( - micromark("[x]: \n\n[x]"), + to_html("[x]: \n\n[x]"), "

x

", "should support ascii control characters in enclosed destinations" ); assert_eq!( - micromark("[x]: a \"\\\"\"\n\n[x]"), + to_html("[x]: a \"\\\"\"\n\n[x]"), "

x

", "should support character escapes at the start of a title" ); assert_eq!( - micromark("[x]: a \"'\"\n\n[x]"), + to_html("[x]: a \"'\"\n\n[x]"), "

x

", "should support double quoted titles" ); assert_eq!( - micromark("[x]: a '\"'\n\n[x]"), + to_html("[x]: a '\"'\n\n[x]"), "

x

", "should support single quoted titles" ); assert_eq!( - micromark("[x]: a (\"')\n\n[x]"), + to_html("[x]: a (\"')\n\n[x]"), "

x

", "should support paren enclosed titles" ); assert_eq!( - micromark("[x]: a(()\n\n[x]"), + to_html("[x]: a(()\n\n[x]"), "

[x]: a(()

\n

[x]

", "should not support more opening than closing parens in the destination" ); assert_eq!( - micromark("[x]: a(())\n\n[x]"), + to_html("[x]: a(())\n\n[x]"), "

x

", "should support balanced opening and closing parens in the destination" ); assert_eq!( - micromark("[x]: a())\n\n[x]"), + to_html("[x]: a())\n\n[x]"), "

[x]: a())

\n

[x]

", "should not support more closing than opening parens in the destination" ); assert_eq!( - micromark("[x]: a \t\n\n[x]"), + to_html("[x]: a \t\n\n[x]"), "

x

", "should support trailing whitespace after a destination" ); assert_eq!( - micromark("[x]: a \"X\" \t\n\n[x]"), + to_html("[x]: a \"X\" \t\n\n[x]"), "

x

", "should support trailing whitespace after a title" ); assert_eq!( - micromark("[&©&]: example.com/&©& \"&©&\"\n\n[&©&]"), + to_html("[&©&]: example.com/&©& \"&©&\"\n\n[&©&]"), "

&©&

", "should support character references in definitions" ); assert_eq!( - micromark("[x]:\nexample.com\n\n[x]"), + to_html("[x]:\nexample.com\n\n[x]"), "

x

", "should support a line ending before a destination" ); assert_eq!( - micromark("[x]: \t\nexample.com\n\n[x]"), + to_html("[x]: \t\nexample.com\n\n[x]"), "

x

", "should support whitespace before a destination" ); // See: assert_eq!( - micromark("[x]: <> \"\"\n[][x]"), + to_html("[x]: <> \"\"\n[][x]"), "

", "should ignore an empty title" ); assert_eq!( - micromark_with_options("[a]\n\n[a]: ", &danger)?, + to_html_with_options("[a]\n\n[a]: ", &danger)?, "

[a]

\n

[a]: <b

", "should not support a less than in an enclosed destination" ); assert_eq!( - micromark("[a]\n\n[a]: b(c"), + to_html("[a]\n\n[a]: b(c"), "

[a]

\n

[a]: b(c

", "should not support an extra left paren (`(`) in a raw destination" ); assert_eq!( - micromark("[a]\n\n[a]: b)c"), + to_html("[a]\n\n[a]: b)c"), "

[a]

\n

[a]: b)c

", "should not support an extra right paren (`)`) in a raw destination" ); assert_eq!( - micromark("[a]\n\n[a]: b)c"), + to_html("[a]\n\n[a]: b)c"), "

[a]

\n

[a]: b)c

", "should not support an extra right paren (`)`) in a raw destination" ); assert_eq!( - micromark("[a]\n\n[a]: a(1(2(3(4()))))b"), + to_html("[a]\n\n[a]: a(1(2(3(4()))))b"), "

a

\n", "should support 4 or more sets of parens in a raw destination (link resources don’t)" ); assert_eq!( - micromark("[a]\n\n[a]: aaa)"), + to_html("[a]\n\n[a]: aaa)"), "

[a]

\n

[a]: aaa)

", "should not support a final (unbalanced) right paren in a raw destination" ); assert_eq!( - micromark("[a]\n\n[a]: aaa) \"a\""), + to_html("[a]\n\n[a]: aaa) \"a\""), "

[a]

\n

[a]: aaa) "a"

", "should not support a final (unbalanced) right paren in a raw destination “before” a title" ); assert_eq!( - micromark(" [a]: b \"c\"\n [d]: e\n [f]: g \"h\"\n [i]: j\n\t[k]: l (m)\n\t n [k] o"), + to_html(" [a]: b \"c\"\n [d]: e\n [f]: g \"h\"\n [i]: j\n\t[k]: l (m)\n\t n [k] o"), "

n k o

", "should support subsequent indented definitions" ); assert_eq!( - micromark("[a\n b]: c\n\n[a\n b]"), + to_html("[a\n b]: c\n\n[a\n b]"), "

a\nb

", "should support line prefixes in definition labels" ); assert_eq!( - micromark("[a]: )\n\n[a]"), + to_html("[a]: )\n\n[a]"), "

[a]: )

\n

[a]

", "should not support definitions w/ only a closing paren as a raw destination" ); assert_eq!( - micromark("[a]: )b\n\n[a]"), + to_html("[a]: )b\n\n[a]"), "

[a]: )b

\n

[a]

", "should not support definitions w/ closing paren + more text as a raw destination" ); assert_eq!( - micromark("[a]: b)\n\n[a]"), + to_html("[a]: b)\n\n[a]"), "

[a]: b)

\n

[a]

", "should not support definitions w/ text + a closing paren as a raw destination" ); assert_eq!( - micromark("[\na\n=\n]: b"), + to_html("[\na\n=\n]: b"), "

[\na

\n

]: b

", "should prefer setext headings over definition labels" ); assert_eq!( - micromark("[a]: b '\nc\n=\n'"), + to_html("[a]: b '\nc\n=\n'"), "

[a]: b '\nc

\n

'

", "should prefer setext headings over definition titles" ); assert_eq!( - micromark("[\n***\n]: b"), + to_html("[\n***\n]: b"), "

[

\n
\n

]: b

", "should prefer thematic breaks over definition labels" ); assert_eq!( - micromark("[a]: b '\n***\n'"), + to_html("[a]: b '\n***\n'"), "

[a]: b '

\n
\n

'

", "should prefer thematic breaks over definition titles" ); assert_eq!( - micromark("[\n```\n]: b"), + to_html("[\n```\n]: b"), "

[

\n
]: b\n
\n", "should prefer code (fenced) over definition labels" ); assert_eq!( - micromark("[a]: b '\n```\n'"), + to_html("[a]: b '\n```\n'"), "

[a]: b '

\n
'\n
\n", "should prefer code (fenced) over definition titles" ); assert_eq!( - micromark_with_options( + to_html_with_options( "[foo]: /url \"title\"", &Options { parse: ParseOptions { @@ -503,7 +503,7 @@ fn definition() -> Result<(), String> { ); assert_eq!( - micromark_to_mdast("[a]: 'c'", &ParseOptions::default())?, + to_mdast("[a]: 'c'", &ParseOptions::default())?, Node::Root(Root { children: vec![Node::Definition(Definition { url: "b".into(), diff --git a/tests/frontmatter.rs b/tests/frontmatter.rs index be17a7a..267b694 100644 --- a/tests/frontmatter.rs +++ b/tests/frontmatter.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{Node, Root, Toml, Yaml}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, Constructs, Options, ParseOptions, }; @@ -21,61 +21,61 @@ fn frontmatter() -> Result<(), String> { }; assert_eq!( - micromark("---\ntitle: Jupyter\n---"), + to_html("---\ntitle: Jupyter\n---"), "
\n

title: Jupyter

", "should not support frontmatter by default" ); assert_eq!( - micromark_with_options("---\ntitle: Jupyter\n---", &frontmatter)?, + to_html_with_options("---\ntitle: Jupyter\n---", &frontmatter)?, "", "should support frontmatter (yaml)" ); assert_eq!( - micromark_with_options("+++\ntitle = \"Jupyter\"\n+++", &frontmatter)?, + to_html_with_options("+++\ntitle = \"Jupyter\"\n+++", &frontmatter)?, "", "should support frontmatter (toml)" ); assert_eq!( - micromark_with_options("---\n---", &frontmatter)?, + to_html_with_options("---\n---", &frontmatter)?, "", "should support empty frontmatter" ); assert_eq!( - micromark_with_options("---\n---\n## Neptune", &frontmatter)?, + to_html_with_options("---\n---\n## Neptune", &frontmatter)?, "

Neptune

", "should support content after frontmatter" ); assert_eq!( - micromark_with_options("## Neptune\n---\n---", &frontmatter)?, + to_html_with_options("## Neptune\n---\n---", &frontmatter)?, "

Neptune

\n
\n
", "should not support frontmatter after content" ); assert_eq!( - micromark_with_options("> ---\n> ---\n> ## Neptune", &frontmatter)?, + to_html_with_options("> ---\n> ---\n> ## Neptune", &frontmatter)?, "
\n
\n
\n

Neptune

\n
", "should not support frontmatter in a container" ); assert_eq!( - micromark_with_options("---", &frontmatter)?, + to_html_with_options("---", &frontmatter)?, "
", "should not support just an opening fence" ); assert_eq!( - micromark_with_options("---\ntitle: Neptune", &frontmatter)?, + to_html_with_options("---\ntitle: Neptune", &frontmatter)?, "
\n

title: Neptune

", "should not support a missing closing fence" ); assert_eq!( - micromark_to_mdast("---\na: b\n---", &frontmatter.parse)?, + to_mdast("---\na: b\n---", &frontmatter.parse)?, Node::Root(Root { children: vec![Node::Yaml(Yaml { value: "a: b".into(), @@ -87,7 +87,7 @@ fn frontmatter() -> Result<(), String> { ); assert_eq!( - micromark_to_mdast("+++\ntitle = \"Jupyter\"\n+++", &frontmatter.parse)?, + to_mdast("+++\ntitle = \"Jupyter\"\n+++", &frontmatter.parse)?, Node::Root(Root { children: vec![Node::Toml(Toml { value: "title = \"Jupyter\"".into(), diff --git a/tests/fuzz.rs b/tests/fuzz.rs index 8233ebf..819edf6 100644 --- a/tests/fuzz.rs +++ b/tests/fuzz.rs @@ -1,13 +1,11 @@ -extern crate micromark; -use micromark::{ - micromark, micromark_with_options, CompileOptions, Constructs, Options, ParseOptions, -}; +extern crate markdown; +use markdown::{to_html, to_html_with_options, CompileOptions, Constructs, Options, ParseOptions}; use pretty_assertions::assert_eq; #[test] fn fuzz() -> Result<(), String> { assert_eq!( - micromark("[\n~\na\n-\n\n"), + to_html("[\n~\na\n-\n\n"), "

[\n~\na

\n", "1: label, blank lines, and code" ); @@ -15,7 +13,7 @@ fn fuzz() -> Result<(), String> { // The first link is stopped by the `+` (so it’s `a@b.c`), but the next // link overlaps it (`b.c+d@e.f`). assert_eq!( - micromark_with_options( + to_html_with_options( "a@b.c+d@e.f", &Options { parse: ParseOptions { @@ -33,13 +31,13 @@ fn fuzz() -> Result<(), String> { ); assert_eq!( - micromark(" x\n* "), + to_html(" x\n* "), "
x\n
\n
    \n
  • \n
", "3-a: containers should not pierce into indented code" ); assert_eq!( - micromark(" a\n* b"), + to_html(" a\n* b"), "
a\n
\n
    \n
  • \n
    b\n
    \n
  • \n
", "3-b: containers should not pierce into indented code" ); diff --git a/tests/gfm_autolink_literal.rs b/tests/gfm_autolink_literal.rs index c608533..cdeecd3 100644 --- a/tests/gfm_autolink_literal.rs +++ b/tests/gfm_autolink_literal.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{Link, Node, Paragraph, Root, Text}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, Constructs, Options, ParseOptions, }; @@ -18,181 +18,181 @@ fn gfm_autolink_literal() -> Result<(), String> { }; assert_eq!( - micromark("https://example.com"), + to_html("https://example.com"), "

https://example.com

", "should ignore protocol urls by default" ); assert_eq!( - micromark("www.example.com"), + to_html("www.example.com"), "

www.example.com

", "should ignore www urls by default" ); assert_eq!( - micromark("user@example.com"), + to_html("user@example.com"), "

user@example.com

", "should ignore email urls by default" ); assert_eq!( - micromark_with_options("https://example.com", &gfm)?, + to_html_with_options("https://example.com", &gfm)?, "

https://example.com

", "should support protocol urls if enabled" ); assert_eq!( - micromark_with_options("www.example.com", &gfm)?, + to_html_with_options("www.example.com", &gfm)?, "

www.example.com

", "should support www urls if enabled" ); assert_eq!( - micromark_with_options("user@example.com", &gfm)?, + to_html_with_options("user@example.com", &gfm)?, "

user@example.com

", "should support email urls if enabled" ); assert_eq!( - micromark_with_options("[https://example.com](xxx)", &gfm)?, + to_html_with_options("[https://example.com](xxx)", &gfm)?, "

https://example.com

", "should not link protocol urls in links" ); assert_eq!( - micromark_with_options("[www.example.com](xxx)", &gfm)?, + to_html_with_options("[www.example.com](xxx)", &gfm)?, "

www.example.com

", "should not link www urls in links" ); assert_eq!( - micromark_with_options("[user@example.com](xxx)", &gfm)?, + to_html_with_options("[user@example.com](xxx)", &gfm)?, "

user@example.com

", "should not link email urls in links" ); assert_eq!( - micromark_with_options("user@example.com", &gfm)?, + to_html_with_options("user@example.com", &gfm)?, "

user@example.com

", "should support a closing paren at TLD (email)" ); assert_eq!( - micromark_with_options("www.a.)", &gfm)?, + to_html_with_options("www.a.)", &gfm)?, "

www.a.)

", "should support a closing paren at TLD (www)" ); assert_eq!( - micromark_with_options("www.a b", &gfm)?, + to_html_with_options("www.a b", &gfm)?, "

www.a b

", "should support no TLD" ); assert_eq!( - micromark_with_options("www.a/b c", &gfm)?, + to_html_with_options("www.a/b c", &gfm)?, "

www.a/b c

", "should support a path instead of TLD" ); assert_eq!( - micromark_with_options("www.�a", &gfm)?, + to_html_with_options("www.�a", &gfm)?, "

www.�a

", "should support a replacement character in a domain" ); assert_eq!( - micromark_with_options("http://點看.com", &gfm)?, + to_html_with_options("http://點看.com", &gfm)?, "

http://點看.com

", "should support non-ascii characters in a domain (http)" ); assert_eq!( - micromark_with_options("www.點看.com", &gfm)?, + to_html_with_options("www.點看.com", &gfm)?, "

www.點看.com

", "should support non-ascii characters in a domain (www)" ); assert_eq!( - micromark_with_options("點看@example.com", &gfm)?, + to_html_with_options("點看@example.com", &gfm)?, "

點看@example.com

", "should *not* support non-ascii characters in atext (email)" ); assert_eq!( - micromark_with_options("example@點看.com", &gfm)?, + to_html_with_options("example@點看.com", &gfm)?, "

example@點看.com

", "should *not* support non-ascii characters in a domain (email)" ); assert_eq!( - micromark_with_options("www.a.com/點看", &gfm)?, + to_html_with_options("www.a.com/點看", &gfm)?, "

www.a.com/點看

", "should support non-ascii characters in a path" ); assert_eq!( - micromark_with_options("www.-a.b", &gfm)?, + to_html_with_options("www.-a.b", &gfm)?, "

www.-a.b

", "should support a dash to start a domain" ); assert_eq!( - micromark_with_options("www.$", &gfm)?, + to_html_with_options("www.$", &gfm)?, "

www.$

", "should support a dollar as a domain name" ); assert_eq!( - micromark_with_options("www.a..b.c", &gfm)?, + to_html_with_options("www.a..b.c", &gfm)?, "

www.a..b.c

", "should support adjacent dots in a domain name" ); assert_eq!( - micromark_with_options("www.a&a;", &gfm)?, + to_html_with_options("www.a&a;", &gfm)?, "

www.a&a;

", "should support named character references in domains" ); assert_eq!( - micromark_with_options("https://a.bc/d/e/).", &gfm)?, + to_html_with_options("https://a.bc/d/e/).", &gfm)?, "

https://a.bc/d/e/).

", "should support a closing paren and period after a path" ); assert_eq!( - micromark_with_options("https://a.bc/d/e/.)", &gfm)?, + to_html_with_options("https://a.bc/d/e/.)", &gfm)?, "

https://a.bc/d/e/.)

", "should support a period and closing paren after a path" ); assert_eq!( - micromark_with_options("https://a.bc).", &gfm)?, + to_html_with_options("https://a.bc).", &gfm)?, "

https://a.bc).

", "should support a closing paren and period after a domain" ); assert_eq!( - micromark_with_options("https://a.bc.)", &gfm)?, + to_html_with_options("https://a.bc.)", &gfm)?, "

https://a.bc.)

", "should support a period and closing paren after a domain" ); assert_eq!( - micromark_with_options("https://a.bc).d", &gfm)?, + to_html_with_options("https://a.bc).d", &gfm)?, "

https://a.bc).d

", "should support a closing paren and period in a path" ); assert_eq!( - micromark_with_options("https://a.bc.)d", &gfm)?, + to_html_with_options("https://a.bc.)d", &gfm)?, "

https://a.bc.)d

", "should support a period and closing paren in a path" ); assert_eq!( - micromark_with_options("https://a.bc/))d", &gfm)?, + to_html_with_options("https://a.bc/))d", &gfm)?, "

https://a.bc/))d

", "should support two closing parens in a path" ); assert_eq!( - micromark_with_options("ftp://a/b/c.txt", &gfm)?, + to_html_with_options("ftp://a/b/c.txt", &gfm)?, "

ftp://a/b/c.txt

", "should not support ftp links" ); @@ -201,25 +201,25 @@ fn gfm_autolink_literal() -> Result<(), String> { // Fixing it would mean deviating from `cmark-gfm`: // Source: . // assert_eq!( - // micromark_with_options(",www.example.com", &gfm)?, + // to_html_with_options(",www.example.com", &gfm)?, // "

www.example.com

", // "should support www links after Unicode punctuation", // ); assert_eq!( - micromark_with_options(",https://example.com", &gfm)?, + to_html_with_options(",https://example.com", &gfm)?, "

https://example.com

", "should support http links after Unicode punctuation" ); assert_eq!( - micromark_with_options(",example@example.com", &gfm)?, + to_html_with_options(",example@example.com", &gfm)?, "

example@example.com

", "should support email links after Unicode punctuation" ); assert_eq!( - micromark_with_options( + to_html_with_options( "http://user:password@host:port/path?key=value#fragment", &gfm )?, @@ -228,13 +228,13 @@ fn gfm_autolink_literal() -> Result<(), String> { ); assert_eq!( - micromark_with_options("http://example.com/abhttp://example.com/ab<cd

", "should stop domains/paths at `<`" ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" mailto:scyther@pokemon.com @@ -277,7 +277,7 @@ Email me at:scyther@pokemon.com"###, ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" a www.example.com&xxx;b c @@ -326,7 +326,7 @@ a www.example.com& b // Note: this deviates from GFM, as is fixed. assert_eq!( - micromark_with_options( + to_html_with_options( r###" [ www.example.com @@ -371,7 +371,7 @@ a www.example.com& b ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" www.example.com/?=a(b)cccccc @@ -422,7 +422,7 @@ www.example.com/?q=a(business))) // Here, the following issues are fixed: // - assert_eq!( - micromark_with_options( + to_html_with_options( r###" # Literal autolinks @@ -611,7 +611,7 @@ Can contain an underscore followed by a period: aaa@a.b_.c ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"H0. [https://a.com©b @@ -673,7 +673,7 @@ H5. ); assert_eq!( - micromark_with_options(r###"Image start. + to_html_with_options(r###"Image start. ![https://a.com @@ -755,7 +755,7 @@ Autolink literal after image. ); assert_eq!( - micromark_with_options(r###"Link start. + to_html_with_options(r###"Link start. [https://a.com @@ -927,7 +927,7 @@ Autolink literal after link. ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# “character reference” www.a&b (space) @@ -1040,7 +1040,7 @@ www.a&b~ ); assert_eq!( - micromark_with_options(r###"# “character reference” + to_html_with_options(r###"# “character reference” www.a# (space) @@ -1150,7 +1150,7 @@ www.a#~ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"a@0.0 a@0.b @@ -1203,7 +1203,7 @@ react@0.0.0-experimental-aae83a4b9 ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# httpshhh? (2) http://a (space) @@ -1316,7 +1316,7 @@ http://a~ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# httpshhh? (1) http:// (space) @@ -1429,7 +1429,7 @@ http://~ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# httpshhh? (4) http://a/b (space) @@ -1542,7 +1542,7 @@ http://a/b~ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# httpshhh? (3) http://a/ (space) @@ -1655,7 +1655,7 @@ http://a/~ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[www.example.com/a©](#) www.example.com/a© @@ -1681,7 +1681,7 @@ www.example.com/a\. ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# “character reference” www.a/b&c (space) @@ -1794,7 +1794,7 @@ www.a/b&c~ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# “character reference” www.a/b# (space) @@ -1907,7 +1907,7 @@ www.a/b#~ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"In autolink literal path or link end? [https://a.com/d]() @@ -1978,7 +1978,7 @@ www.a.com#d]() ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Last non-markdown ASCII whitespace (FF): noreply@example.com, http://example.com, https://example.com, www.example.com Last non-whitespace ASCII control (US): noreply@example.com, http://example.com, https://example.com, www.example.com @@ -2052,7 +2052,7 @@ Some more non-ascii: 🤷‍noreply@example.com, 🤷‍http://example.com, 🤷 ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# HTTP https://a.b can start after EOF @@ -2179,7 +2179,7 @@ github.com: !a@b.c, "a@b. ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# wwwtf 2? www.a (space) @@ -2292,7 +2292,7 @@ www.a~ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# wwwtf 5? www.a. (space) @@ -2405,7 +2405,7 @@ www.a.~ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# wwwtf? www. (space) @@ -2518,7 +2518,7 @@ www.~ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# wwwtf? (4) www.a/b (space) @@ -2631,7 +2631,7 @@ www.a/b~ ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# wwwtf? (3) www.a/ (space) @@ -2744,7 +2744,7 @@ www.a/~ ); assert_eq!( - micromark_to_mdast( + to_mdast( "a https://alpha.com b bravo@charlie.com c www.delta.com d xmpp:echo@foxtrot.com e mailto:golf@hotel.com f.", &gfm.parse )?, diff --git a/tests/gfm_footnote.rs b/tests/gfm_footnote.rs index 4b2be52..3464193 100644 --- a/tests/gfm_footnote.rs +++ b/tests/gfm_footnote.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{FootnoteDefinition, FootnoteReference, Node, Paragraph, Root, Text}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, CompileOptions, Constructs, Options, ParseOptions, }; @@ -18,13 +18,13 @@ fn gfm_footnote() -> Result<(), String> { }; assert_eq!( - micromark("A call.[^a]\n\n[^a]: whatevs"), + to_html("A call.[^a]\n\n[^a]: whatevs"), "

A call.^a

\n", "should ignore footnotes by default" ); assert_eq!( - micromark_with_options("A call.[^a]\n\n[^a]: whatevs", &gfm)?, + to_html_with_options("A call.[^a]\n\n[^a]: whatevs", &gfm)?, "

A call.1

Footnotes

    @@ -38,7 +38,7 @@ fn gfm_footnote() -> Result<(), String> { ); assert_eq!( - micromark_with_options( + to_html_with_options( "Noot.[^a]\n\n[^a]: dingen", &Options { parse: ParseOptions { @@ -65,7 +65,7 @@ fn gfm_footnote() -> Result<(), String> { ); assert_eq!( - micromark_with_options( + to_html_with_options( "[^a]\n\n[^a]: b", &Options { parse: ParseOptions { @@ -91,7 +91,7 @@ fn gfm_footnote() -> Result<(), String> { ); assert_eq!( - micromark_with_options( + to_html_with_options( "[^a]\n\n[^a]: b", &Options { parse: ParseOptions { @@ -117,7 +117,7 @@ fn gfm_footnote() -> Result<(), String> { ); assert_eq!( - micromark_with_options( + to_html_with_options( "[^a]\n\n[^a]: b", &Options { parse: ParseOptions { @@ -143,19 +143,19 @@ fn gfm_footnote() -> Result<(), String> { ); assert_eq!( - micromark_with_options("A paragraph.\n\n[^a]: whatevs", &gfm)?, + to_html_with_options("A paragraph.\n\n[^a]: whatevs", &gfm)?, "

    A paragraph.

    \n", "should ignore definitions w/o calls" ); assert_eq!( - micromark_with_options("a[^b]", &gfm)?, + to_html_with_options("a[^b]", &gfm)?, "

    a[^b]

    ", "should ignore calls w/o definitions" ); assert_eq!( - micromark_with_options("a[^b]\n\n[^b]: c\n[^b]: d", &gfm)?, + to_html_with_options("a[^b]\n\n[^b]: c\n[^b]: d", &gfm)?, "

    a1

    Footnotes

      @@ -169,7 +169,7 @@ fn gfm_footnote() -> Result<(), String> { ); assert_eq!( - micromark_with_options("a[^b], c[^b]\n\n[^b]: d", &gfm)?, + to_html_with_options("a[^b], c[^b]\n\n[^b]: d", &gfm)?, "

      a1, c1

      Footnotes

        @@ -183,32 +183,32 @@ fn gfm_footnote() -> Result<(), String> { ); assert_eq!( - micromark_with_options("![^a](b)", &gfm)?, + to_html_with_options("![^a](b)", &gfm)?, "

        !^a

        ", "should not support images starting w/ `^` (but see it as a link?!, 1)" ); assert_eq!( - micromark_with_options("![^a][b]\n\n[b]: c", &gfm)?, + to_html_with_options("![^a][b]\n\n[b]: c", &gfm)?, "

        !^a

        \n", "should not support images starting w/ `^` (but see it as a link?!, 2)" ); assert_eq!( - micromark_with_options("[^]()", &gfm)?, + to_html_with_options("[^]()", &gfm)?, "

        ^

        ", "should support an empty link with caret" ); assert_eq!( - micromark_with_options("![^]()", &gfm)?, + to_html_with_options("![^]()", &gfm)?, "

        !^

        ", "should support an empty image with caret (as link)" ); // assert_eq!( - micromark_with_options("Call.[^a\\+b].\n\n[^a\\+b]: y", &gfm)?, + to_html_with_options("Call.[^a\\+b].\n\n[^a\\+b]: y", &gfm)?, "

        Call.1.

        Footnotes

          @@ -222,7 +222,7 @@ fn gfm_footnote() -> Result<(), String> { ); assert_eq!( - micromark_with_options("Call.[^a©b].\n\n[^a©b]: y", &gfm)?, + to_html_with_options("Call.[^a©b].\n\n[^a©b]: y", &gfm)?, "

          Call.1.

          Footnotes

            @@ -238,7 +238,7 @@ fn gfm_footnote() -> Result<(), String> { // // assert_eq!( - micromark_with_options("Call.[^a\\]b].\n\n[^a\\]b]: y", &gfm)?, + to_html_with_options("Call.[^a\\]b].\n\n[^a\\]b]: y", &gfm)?, "

            Call.1.

            Footnotes

              @@ -252,7 +252,7 @@ fn gfm_footnote() -> Result<(), String> { ); assert_eq!( - micromark_with_options("Call.[^a[b].\n\n[^a[b]: y", &gfm)?, + to_html_with_options("Call.[^a[b].\n\n[^a[b]: y", &gfm)?, "

              Call.1.

              Footnotes

                @@ -266,19 +266,19 @@ fn gfm_footnote() -> Result<(), String> { ); assert_eq!( - micromark_with_options("Call.[^a\\+b].\n\n[^a+b]: y", &gfm)?, + to_html_with_options("Call.[^a\\+b].\n\n[^a+b]: y", &gfm)?, "

                Call.[^a+b].

                \n", "should match calls to definitions on the source of the label, not on resolved escapes" ); assert_eq!( - micromark_with_options("Call.[^a[b].\n\n[^a\\[b]: y", &gfm)?, + to_html_with_options("Call.[^a[b].\n\n[^a\\[b]: y", &gfm)?, "

                Call.[^a[b].

                \n", "should match calls to definitions on the source of the label, not on resolved references" ); assert_eq!( - micromark_with_options("[^1].\n\n[^1]: a\nb", &gfm)?, + to_html_with_options("[^1].\n\n[^1]: a\nb", &gfm)?, "

                1.

                Footnotes

                  @@ -293,7 +293,7 @@ b [^1]: a\nb", &gfm)?, + to_html_with_options("[^1].\n\n> [^1]: a\nb", &gfm)?, "

                  1.

                  @@ -310,7 +310,7 @@ b [^1]: a\n> b", &gfm)?, + to_html_with_options("[^1].\n\n> [^1]: a\n> b", &gfm)?, "

                  1.

                  @@ -327,7 +327,7 @@ b b", &gfm)?, + to_html_with_options("[^1].\n\n[^1]: a\n\n > b", &gfm)?, "

                  1.

                  Footnotes

                    @@ -348,7 +348,7 @@ b Call.1.

                    Footnotes

                      @@ -362,7 +362,7 @@ b a![^1]

                      ", "should match bang/caret interplay (undefined) like GitHub" ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"a![^1] [^1]: b @@ -428,7 +428,7 @@ a!
                      // See: // Here line endings don’t make text disappear. assert_eq!( - micromark_with_options( + to_html_with_options( r###"[^a]: # b [^c d]: # e @@ -545,7 +545,7 @@ j], [^ l], [^m ]

                      ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[^*emphasis*] [^**strong**] @@ -624,7 +624,7 @@ j], [^ l], [^m ]

                      ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Call[^1][^2][^3][^4] > [^1]: Defined in a block quote. @@ -669,7 +669,7 @@ j], [^ l], [^m ]

                      ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"[^1][^2][^3][^4] [^1]: Paragraph @@ -731,7 +731,7 @@ j], [^ l], [^m ]

                      ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Call[^1][^2][^3][^4][^5]. [^1]: @@ -781,7 +781,7 @@ Lazy! ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"Note![^0][^1][^2][^3][^4][^5][^6][^7][^8][^9][^10] [^0]: alpha @@ -875,7 +875,7 @@ indented delta
                      Result<(), String> { }; assert_eq!( - micromark("a ~b~ c"), + to_html("a ~b~ c"), "

                      a ~b~ c

                      ", "should ignore strikethrough by default" ); assert_eq!( - micromark_with_options("a ~b~", &gfm)?, + to_html_with_options("a ~b~", &gfm)?, "

                      a b

                      ", "should support strikethrough w/ one tilde" ); assert_eq!( - micromark_with_options("a ~~b~~", &gfm)?, + to_html_with_options("a ~~b~~", &gfm)?, "

                      a b

                      ", "should support strikethrough w/ two tildes" ); assert_eq!( - micromark_with_options("a ~~~b~~~", &gfm)?, + to_html_with_options("a ~~~b~~~", &gfm)?, "

                      a ~~~b~~~

                      ", "should not support strikethrough w/ three tildes" ); assert_eq!( - micromark_with_options("a \\~~~b~~ c", &gfm)?, + to_html_with_options("a \\~~~b~~ c", &gfm)?, "

                      a ~b c

                      ", "should support strikethrough after an escaped tilde" ); assert_eq!( - micromark_with_options("a ~~b ~~c~~ d~~ e", &gfm)?, + to_html_with_options("a ~~b ~~c~~ d~~ e", &gfm)?, "

                      a b c d e

                      ", "should support nested strikethrough" ); assert_eq!( - micromark_with_options("a ~-1~ b", &gfm)?, + to_html_with_options("a ~-1~ b", &gfm)?, "

                      a -1 b

                      ", "should open if preceded by whitespace and followed by punctuation" ); assert_eq!( - micromark_with_options("a ~b.~ c", &gfm)?, + to_html_with_options("a ~b.~ c", &gfm)?, "

                      a b. c

                      ", "should close if preceded by punctuation and followed by whitespace" ); assert_eq!( - micromark_with_options("~b.~.", &gfm)?, + to_html_with_options("~b.~.", &gfm)?, "

                      b..

                      ", "should close if preceded and followed by punctuation" ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" # Balanced @@ -165,7 +165,7 @@ a ~~two b two~~ c one~ d ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" # Flank @@ -222,7 +222,7 @@ a ~~twoLeft b ~~twoLeft c ~~twoLeft d ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" # Interlpay @@ -368,7 +368,7 @@ u ~**xxx**~ zzz ); assert_eq!( - micromark_with_options( + to_html_with_options( "a ~b~ ~~c~~ d", &Options { parse: ParseOptions { @@ -384,7 +384,7 @@ u ~**xxx**~ zzz ); assert_eq!( - micromark_with_options( + to_html_with_options( "a ~b~ ~~c~~ d", &Options { parse: ParseOptions { @@ -400,7 +400,7 @@ u ~**xxx**~ zzz ); assert_eq!( - micromark_to_mdast("a ~~alpha~~ b.", &gfm.parse)?, + to_mdast("a ~~alpha~~ b.", &gfm.parse)?, Node::Root(Root { children: vec![Node::Paragraph(Paragraph { children: vec![ diff --git a/tests/gfm_table.rs b/tests/gfm_table.rs index 8e871f6..d824355 100644 --- a/tests/gfm_table.rs +++ b/tests/gfm_table.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{AlignKind, InlineCode, Node, Root, Table, TableCell, TableRow, Text}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, CompileOptions, Constructs, Options, ParseOptions, }; @@ -18,193 +18,193 @@ fn gfm_table() -> Result<(), String> { }; assert_eq!( - micromark("| a |\n| - |\n| b |"), + to_html("| a |\n| - |\n| b |"), "

                      | a |\n| - |\n| b |

                      ", "should ignore tables by default" ); assert_eq!( - micromark_with_options("| a |\n| - |\n| b |", &gfm)?, + to_html_with_options("| a |\n| - |\n| b |", &gfm)?, "
\n\n\n\n\n\n\n\n\n\n\n
a
b
", "should support tables" ); assert_eq!( - micromark_with_options("| a |", &gfm)?, + to_html_with_options("| a |", &gfm)?, "

| a |

", "should not support a table w/ the head row ending in an eof (1)" ); assert_eq!( - micromark_with_options("| a", &gfm)?, + to_html_with_options("| a", &gfm)?, "

| a

", "should not support a table w/ the head row ending in an eof (2)" ); assert_eq!( - micromark_with_options("a |", &gfm)?, + to_html_with_options("a |", &gfm)?, "

a |

", "should not support a table w/ the head row ending in an eof (3)" ); assert_eq!( - micromark_with_options("| a |\n| - |", &gfm)?, + to_html_with_options("| a |\n| - |", &gfm)?, "\n\n\n\n\n\n
a
", "should support a table w/ a delimiter row ending in an eof (1)" ); assert_eq!( - micromark_with_options("| a\n| -", &gfm)?, + to_html_with_options("| a\n| -", &gfm)?, "\n\n\n\n\n\n
a
", "should support a table w/ a delimiter row ending in an eof (2)" ); assert_eq!( - micromark_with_options("| a |\n| - |\n| b |", &gfm)?, + to_html_with_options("| a |\n| - |\n| b |", &gfm)?, "\n\n\n\n\n\n\n\n\n\n\n
a
b
", "should support a table w/ a body row ending in an eof (1)" ); assert_eq!( - micromark_with_options("| a\n| -\n| b", &gfm)?, + to_html_with_options("| a\n| -\n| b", &gfm)?, "\n\n\n\n\n\n\n\n\n\n\n
a
b
", "should support a table w/ a body row ending in an eof (2)" ); assert_eq!( - micromark_with_options("a|b\n-|-\nc|d", &gfm)?, + to_html_with_options("a|b\n-|-\nc|d", &gfm)?, "\n\n\n\n\n\n\n\n\n\n\n\n\n
ab
cd
", "should support a table w/ a body row ending in an eof (3)" ); assert_eq!( - micromark_with_options("| a \n| -\t\n| b | ", &gfm)?, + to_html_with_options("| a \n| -\t\n| b | ", &gfm)?, "\n\n\n\n\n\n\n\n\n\n\n
a
b
", "should support rows w/ trailing whitespace (1)" ); assert_eq!( - micromark_with_options("| a | \n| - |", &gfm)?, + to_html_with_options("| a | \n| - |", &gfm)?, "\n\n\n\n\n\n
a
", "should support rows w/ trailing whitespace (2)" ); assert_eq!( - micromark_with_options("| a |\n| - | ", &gfm)?, + to_html_with_options("| a |\n| - | ", &gfm)?, "\n\n\n\n\n\n
a
", "should support rows w/ trailing whitespace (3)" ); assert_eq!( - micromark_with_options("| a |\n| - |\n| b | ", &gfm)?, + to_html_with_options("| a |\n| - |\n| b | ", &gfm)?, "\n\n\n\n\n\n\n\n\n\n\n
a
b
", "should support rows w/ trailing whitespace (4)" ); assert_eq!( - micromark_with_options("||a|\n|-|-|", &gfm)?, + to_html_with_options("||a|\n|-|-|", &gfm)?, "\n\n\n\n\n\n\n
a
", "should support empty first header cells" ); assert_eq!( - micromark_with_options("|a||\n|-|-|", &gfm)?, + to_html_with_options("|a||\n|-|-|", &gfm)?, "\n\n\n\n\n\n\n
a
", "should support empty last header cells" ); assert_eq!( - micromark_with_options("a||b\n-|-|-", &gfm)?, + to_html_with_options("a||b\n-|-|-", &gfm)?, "\n\n\n\n\n\n\n\n
ab
", "should support empty header cells" ); assert_eq!( - micromark_with_options("|a|b|\n|-|-|\n||c|", &gfm)?, + to_html_with_options("|a|b|\n|-|-|\n||c|", &gfm)?, "\n\n\n\n\n\n\n\n\n\n\n\n\n
ab
c
", "should support empty first body cells" ); assert_eq!( - micromark_with_options("|a|b|\n|-|-|\n|c||", &gfm)?, + to_html_with_options("|a|b|\n|-|-|\n|c||", &gfm)?, "\n\n\n\n\n\n\n\n\n\n\n\n\n
ab
c
", "should support empty last body cells" ); assert_eq!( - micromark_with_options("a|b|c\n-|-|-\nd||e", &gfm)?, + to_html_with_options("a|b|c\n-|-|-\nd||e", &gfm)?, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
abc
de
", "should support empty body cells" ); assert_eq!( - micromark_with_options("| a |\n| - |\n- b", &gfm)?, + to_html_with_options("| a |\n| - |\n- b", &gfm)?, "\n\n\n\n\n\n
a
\n
    \n
  • b
  • \n
", "should support a list after a table" ); assert_eq!( - micromark_with_options("> | a |\n| - |", &gfm)?, + to_html_with_options("> | a |\n| - |", &gfm)?, "
\n

| a |\n| - |

\n
", "should not support a lazy delimiter row (1)" ); assert_eq!( - micromark_with_options("> a\n> | b |\n| - |", &gfm)?, + to_html_with_options("> a\n> | b |\n| - |", &gfm)?, "
\n

a\n| b |\n| - |

\n
", "should not support a lazy delimiter row (2)" ); assert_eq!( - micromark_with_options("| a |\n> | - |", &gfm)?, + to_html_with_options("| a |\n> | - |", &gfm)?, "

| a |

\n
\n

| - |

\n
", "should not support a piercing delimiter row" ); assert_eq!( - micromark_with_options("> a\n> | b |\n|-", &gfm)?, + to_html_with_options("> a\n> | b |\n|-", &gfm)?, "
\n

a\n| b |\n|-

\n
", "should not support a lazy body row (2)" ); assert_eq!( - micromark_with_options("> | a |\n> | - |\n| b |", &gfm)?, + to_html_with_options("> | a |\n> | - |\n| b |", &gfm)?, "
\n\n\n\n\n\n\n
a
\n
\n

| b |

", "should not support a lazy body row (1)" ); assert_eq!( - micromark_with_options("> a\n> | b |\n> | - |\n| c |", &gfm)?, + to_html_with_options("> a\n> | b |\n> | - |\n| c |", &gfm)?, "
\n

a

\n\n\n\n\n\n\n
b
\n
\n

| c |

", "should not support a lazy body row (2)" ); assert_eq!( - micromark_with_options("> | A |\n> | - |\n> | 1 |\n| 2 |", &gfm)?, + to_html_with_options("> | A |\n> | - |\n> | 1 |\n| 2 |", &gfm)?, "
\n\n\n\n\n\n\n\n\n\n\n\n
A
1
\n
\n

| 2 |

", "should not support a lazy body row (3)" ); assert_eq!( - micromark_with_options(" - d\n - e", &gfm)?, - micromark(" - d\n - e"), + to_html_with_options(" - d\n - e", &gfm)?, + to_html(" - d\n - e"), "should not change how lists and lazyness work" ); assert_eq!( - micromark_with_options("| a |\n | - |", &gfm)?, + to_html_with_options("| a |\n | - |", &gfm)?, "\n\n\n\n\n\n
a
", "should form a table if the delimiter row is indented w/ 3 spaces" ); assert_eq!( - micromark_with_options("| a |\n | - |", &gfm)?, + to_html_with_options("| a |\n | - |", &gfm)?, "

| a |\n| - |

", "should not form a table if the delimiter row is indented w/ 4 spaces" ); assert_eq!( - micromark_with_options("| a |\n | - |", &Options { + to_html_with_options("| a |\n | - |", &Options { parse: ParseOptions { constructs: Constructs { code_indented: false, @@ -219,31 +219,31 @@ fn gfm_table() -> Result<(), String> { ); assert_eq!( - micromark_with_options("| a |\n| - |\n> block quote?", &gfm)?, + to_html_with_options("| a |\n| - |\n> block quote?", &gfm)?, "\n\n\n\n\n\n
a
\n
\n

block quote?

\n
", "should be interrupted by a block quote" ); assert_eq!( - micromark_with_options("| a |\n| - |\n>", &gfm)?, + to_html_with_options("| a |\n| - |\n>", &gfm)?, "\n\n\n\n\n\n
a
\n
\n
", "should be interrupted by a block quote (empty)" ); assert_eq!( - micromark_with_options("| a |\n| - |\n- list?", &gfm)?, + to_html_with_options("| a |\n| - |\n- list?", &gfm)?, "\n\n\n\n\n\n
a
\n
    \n
  • list?
  • \n
", "should be interrupted by a list" ); assert_eq!( - micromark_with_options("| a |\n| - |\n-", &gfm)?, + to_html_with_options("| a |\n| - |\n-", &gfm)?, "\n\n\n\n\n\n
a
\n
    \n
  • \n
", "should be interrupted by a list (empty)" ); assert_eq!( - micromark_with_options( + to_html_with_options( "| a |\n| - |\n", &Options { parse: ParseOptions { @@ -262,7 +262,7 @@ fn gfm_table() -> Result<(), String> { ); assert_eq!( - micromark_with_options("| a |\n| - |\n\tcode?", &Options { + to_html_with_options("| a |\n| - |\n\tcode?", &Options { parse: ParseOptions { constructs: Constructs::gfm(), ..ParseOptions::default() @@ -278,7 +278,7 @@ fn gfm_table() -> Result<(), String> { ); assert_eq!( - micromark_with_options("| a |\n| - |\n```js\ncode?", &Options { + to_html_with_options("| a |\n| - |\n```js\ncode?", &Options { parse: ParseOptions { constructs: Constructs::gfm(), ..ParseOptions::default() @@ -294,7 +294,7 @@ fn gfm_table() -> Result<(), String> { ); assert_eq!( - micromark_with_options( + to_html_with_options( "| a |\n| - |\n***", &Options { parse: ParseOptions { @@ -313,73 +313,73 @@ fn gfm_table() -> Result<(), String> { ); assert_eq!( - micromark_with_options("| a |\n| - |\n# heading?", &gfm)?, + to_html_with_options("| a |\n| - |\n# heading?", &gfm)?, "\n\n\n\n\n\n
a
\n

heading?

", "should be interrupted by a heading (ATX)" ); assert_eq!( - micromark_with_options("| a |\n| - |\nheading\n=", &gfm)?, + to_html_with_options("| a |\n| - |\nheading\n=", &gfm)?, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n
a
heading
=
", "should *not* be interrupted by a heading (setext)" ); assert_eq!( - micromark_with_options("| a |\n| - |\nheading\n---", &gfm)?, + to_html_with_options("| a |\n| - |\nheading\n---", &gfm)?, "\n\n\n\n\n\n\n\n\n\n\n
a
heading
\n
", "should *not* be interrupted by a heading (setext), but interrupt if the underline is also a thematic break" ); assert_eq!( - micromark_with_options("| a |\n| - |\nheading\n-", &gfm)?, + to_html_with_options("| a |\n| - |\nheading\n-", &gfm)?, "\n\n\n\n\n\n\n\n\n\n\n
a
heading
\n
    \n
  • \n
", "should *not* be interrupted by a heading (setext), but interrupt if the underline is also an empty list item bullet" ); assert_eq!( - micromark_with_options("a\nb\n-:", &gfm)?, + to_html_with_options("a\nb\n-:", &gfm)?, "

a

\n\n\n\n\n\n\n
b
", "should support a single head row" ); assert_eq!( - micromark_with_options("> | a |\n> | - |", &gfm)?, + to_html_with_options("> | a |\n> | - |", &gfm)?, "
\n\n\n\n\n\n\n
a
\n
", "should support a table in a container" ); assert_eq!( - micromark_with_options("> | a |\n| - |", &gfm)?, + to_html_with_options("> | a |\n| - |", &gfm)?, "
\n

| a |\n| - |

\n
", "should not support a lazy delimiter row if the head row is in a container" ); assert_eq!( - micromark_with_options("| a |\n> | - |", &gfm)?, + to_html_with_options("| a |\n> | - |", &gfm)?, "

| a |

\n
\n

| - |

\n
", "should not support a “piercing” container for the delimiter row, if the head row was not in that container" ); assert_eq!( - micromark_with_options("> | a |\n> | - |\n| c |", &gfm)?, + to_html_with_options("> | a |\n> | - |\n| c |", &gfm)?, "
\n\n\n\n\n\n\n
a
\n
\n

| c |

", "should not support a lazy body row if the head row and delimiter row are in a container" ); assert_eq!( - micromark_with_options("> | a |\n| - |\n> | c |", &gfm)?, + to_html_with_options("> | a |\n| - |\n> | c |", &gfm)?, "
\n

| a |\n| - |\n| c |

\n
", "should not support a lazy delimiter row if the head row and a further body row are in a container" ); assert_eq!( - micromark_with_options("[\na\n:-\n]: b", &gfm)?, + to_html_with_options("[\na\n:-\n]: b", &gfm)?, "

[

\n\n\n\n\n\n\n\n\n\n\n\n
a
]: b
", "should prefer GFM tables over definitions" ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# Align ## An empty initial cell @@ -569,7 +569,7 @@ a ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# Tables | a | b | c | @@ -634,7 +634,7 @@ a ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# Tables in things ## In lists @@ -828,7 +828,7 @@ a ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"| a | | - | | - | @@ -856,7 +856,7 @@ a ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# Examples from GFM ## A @@ -1036,7 +1036,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# Grave accents ## Grave accent in cell @@ -1172,7 +1172,7 @@ bar ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# Code ## Indented delimiter row @@ -1227,7 +1227,7 @@ a ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"## Blank line a @@ -1725,7 +1725,7 @@ b ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# Loose ## Loose @@ -1784,7 +1784,7 @@ a ); assert_eq!( - micromark_with_options( + to_html_with_options( r###"# Some more escapes | Head | @@ -1832,7 +1832,7 @@ normal escape:
https:// ); assert_eq!( - micromark_to_mdast( + to_mdast( "| none | left | right | center |\n| - | :- | -: | :-: |\n| a |\n| b | c | d | e | f |", &gfm.parse )?, @@ -1937,7 +1937,7 @@ normal escape: https:// ); assert_eq!( - micromark_to_mdast("| `a\\|b` |\n| - |", &gfm.parse)?, + to_mdast("| `a\\|b` |\n| - |", &gfm.parse)?, Node::Root(Root { children: vec![Node::Table(Table { align: vec![AlignKind::None,], diff --git a/tests/gfm_tagfilter.rs b/tests/gfm_tagfilter.rs index 9321d01..d808374 100644 --- a/tests/gfm_tagfilter.rs +++ b/tests/gfm_tagfilter.rs @@ -1,11 +1,11 @@ -extern crate micromark; -use micromark::{micromark_with_options, CompileOptions, Options}; +extern crate markdown; +use markdown::{to_html_with_options, CompileOptions, Options}; use pretty_assertions::assert_eq; #[test] fn gfm_tagfilter() -> Result<(), String> { assert_eq!( - micromark_with_options( + to_html_with_options( "