{-# LANGUAGE OverloadedStrings #-} module Text.MMark.Extension.FootnotesSpec (spec) where import Test.Hspec import Text.MMark.Extension.Footnotes import Text.MMark.Extension.TestUtils spec :: Spec spec = describe "footnotes" $ do let to = withExt footnotes context "when link has no scheme" $ it "has no effect" $ "Link [link](1)." `to` "

Link link.

\n" context "when link has not \"footnote\" scheme" $ it "has no effect" $ "Link [link](https:1)" `to` "

Link link

\n" context "when link has \"footnote\" scheme" $ it "transforms the link correctly" $ "Link [link](footnote:1)" `to` "

Link 1

\n" context "when block quotes are not formatted correctly" $ it "has no effect" $ "> blah" `to` "
\n

blah

\n
\n" context "when block quotes are formatted correctly" $ it "transforms them into footnotes" $ "> footnotes\n\n 1. Something.\n" `to` "
    \n
  1. \nSomething.\n
  2. \n
\n"