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/gfm_footnote.rs | 110 +++++++++++++++++++++++++------------------------- 1 file changed, 55 insertions(+), 55 deletions(-) (limited to 'tests/gfm_footnote.rs') 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