From 0405c5b461ee8d9a57eacc5ff2b44fafa5c0637f Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Thu, 21 Dec 2017 15:33:54 +0300 Subject: Muse reader: parse anchors immediately after headings as IDs --- test/Tests/Readers/Muse.hs | 12 ++++++++++++ test/Tests/Writers/Muse.hs | 5 +++++ 2 files changed, 17 insertions(+) (limited to 'test') diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index 513b54a65..abd230c8c 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -455,6 +455,18 @@ tests = , "" ] =?> blockQuote (para "* Hi") + , "Headers consume anchors" =: + T.unlines [ "** Foo" + , "#bar" + ] =?> + headerWith ("bar",[],[]) 2 "Foo" + , "Headers don't consume anchors separated with a blankline" =: + T.unlines [ "** Foo" + , "" + , "#bar" + ] =?> + header 2 "Foo" <> + para (spanWith ("bar", [], []) mempty) ] , testGroup "Directives" [ "Title" =: diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs index 77e741534..e2e6ba06c 100644 --- a/test/Tests/Writers/Muse.hs +++ b/test/Tests/Writers/Muse.hs @@ -234,6 +234,11 @@ tests = [ testGroup "block elements" , "" , "*** Third level" ] + , "heading with ID" =: + headerWith ("bar", [], []) 2 (text "Foo") =?> + unlines [ "** Foo" + , "#bar" + ] ] , "horizontal rule" =: horizontalRule =?> "----" , "escape horizontal rule" =: para (text "----") =?> "----" -- cgit v1.2.3