diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs index 0f60398ef..0260b6e5d 100644 --- a/src/Text/Pandoc/Readers/Man.hs +++ b/src/Text/Pandoc/Readers/Man.hs @@ -219,7 +219,16 @@ parseTitle = do (ControlLine _ args _) <- mmacro "TH" let adjustMeta = case args of - (x:y:z:_) -> setMeta "title" (linePartsToInlines x) . + (x:y:z:a:b:_) -> setMeta "title" (linePartsToInlines x) . + setMeta "section" (linePartsToInlines y) . + setMeta "date" (linePartsToInlines z) . + setMeta "footer" (linePartsToInlines a) . + setMeta "header" (linePartsToInlines b) + [x,y,z,a] -> setMeta "title" (linePartsToInlines x) . + setMeta "section" (linePartsToInlines y) . + setMeta "date" (linePartsToInlines z) . + setMeta "footer" (linePartsToInlines a) + [x,y,z] -> setMeta "title" (linePartsToInlines x) . setMeta "section" (linePartsToInlines y) . setMeta "date" (linePartsToInlines z) [x,y] -> setMeta "title" (linePartsToInlines x) . diff --git a/test/man-reader.man b/test/man-reader.man index 95d1a9d71..e1b77c92c 100644 --- a/test/man-reader.man +++ b/test/man-reader.man @@ -1,4 +1,4 @@ -.TH "Pandoc Man tests" "" "Oct 17, 2018" "" "" +.TH "PANDOC-MAN-TESTS" "1" "Oct 17, 2018" "v1.0.1" "Pandoc Tests" .PP This is a set of tests for pandoc. .PP diff --git a/test/man-reader.native b/test/man-reader.native index 1fe99ae35..e0d14ca79 100644 --- a/test/man-reader.native +++ b/test/man-reader.native @@ -6,16 +6,12 @@ Pandoc , MetaInlines [ Str "Oct" , Space , Str "17," , Space , Str "2018" ] ) - , ( "section" , MetaInlines [] ) - , ( "title" - , MetaInlines - [ Str "Pandoc" - , Space - , Str "Man" - , Space - , Str "tests" - ] + , ( "footer" , MetaInlines [ Str "v1.0.1" ] ) + , ( "header" + , MetaInlines [ Str "Pandoc" , Space , Str "Tests" ] ) + , ( "section" , MetaInlines [ Str "1" ] ) + , ( "title" , MetaInlines [ Str "PANDOC-MAN-TESTS" ] ) ] } [ Para