From a9fc71118fead17f2dfd122e60f0131efd2e21ea Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 20 Oct 2018 15:57:34 -0700 Subject: Man reader: major restructuring, support macros. - Improved support for custom macro definitions. - LinePart type has been added. RoffStr is now one constructor of LinePart (the other being MacroArg). - MComment has lost its argument. - MEndMacro has been removed. - MStr has been removed (we now simply use LinePart). - Macros now store a list of tokens. - Each macro argument is a [LinePart], instead of a LinePart. - .BR now behaves as documented in man (and doesn't create a link). --- test/Tests/Readers/Man.hs | 8 ++++---- test/man-reader.native | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/Tests/Readers/Man.hs b/test/Tests/Readers/Man.hs index 5368ce542..d45c69705 100644 --- a/test/Tests/Readers/Man.hs +++ b/test/Tests/Readers/Man.hs @@ -24,13 +24,13 @@ tests = [ testGroup "Macros" [ "Bold" =: ".B foo" - =?> (para $ strong "foo") + =?> para (strong "foo") , "Italic" =: ".I bar\n" - =?> (para $ emph "bar") + =?> para (emph "bar") , "BoldItalic" =: ".BI foo bar" - =?> (para $ strong $ emph $ text "foo bar") + =?> para (strong (str "foo") <> emph (str "bar")) , "H1" =: ".SH The header\n" =?> header 1 (text "The header") @@ -45,7 +45,7 @@ tests = [ =?> (para $ str "aaa") , "link" =: ".BR aa (1)" - =?> (para $ link "../1/aa.1" "aa" (strong $ str "aa") <> (strong $ str " (1)")) + =?> para (text "aa(1)") ], testGroup "Escapes" [ "fonts" =: diff --git a/test/man-reader.native b/test/man-reader.native index 470905d44..b0853b683 100644 --- a/test/man-reader.native +++ b/test/man-reader.native @@ -1,4 +1,4 @@ -Pandoc (Meta {unMeta = fromList [("date",MetaString "Oct 17, 2018"),("section",MetaString ""),("title",MetaString "Pandoc Man tests")]}) +Pandoc (Meta {unMeta = fromList [("date",MetaInlines [Str "Oct",Space,Str "17,",Space,Str "2018"]),("section",MetaInlines []),("title",MetaInlines [Str "Pandoc",Space,Str "Man",Space,Str "tests"])]}) [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc."] ,Para [Str "*",Space,Str "*",Space,Str "*",Space,Str "*",Space,Str "*"] ,Header 1 ("",[],[]) [Str "Headers"] -- cgit v1.2.3