From 9f38f9d0391c901adddfc0eb14f114c9b6716e58 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sun, 22 Jul 2007 16:17:20 +0000 Subject: [PATCH] Man writer: + Make sure to include "" if no section is specified in a man page TH line. + Updated man writer tests. git-svn-id: https://pandoc.googlecode.com/svn/trunk@758 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Writers/Man.hs | 4 ++-- tests/writer.man | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index 5d517843f..a0d8447f0 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -73,8 +73,8 @@ metaToMan options (Meta title authors date) = do let (cmdName, rest) = break (== ' ') $ render titleText let (title', section) = case reverse cmdName of (')':d:'(':xs) | d `elem` ['0'..'9'] -> - (text (reverse xs), text [d]) - xs -> (text (reverse xs), empty) + (text (reverse xs), char d) + xs -> (text (reverse xs), doubleQuotes empty) let extras = map (doubleQuotes . text . removeLeadingTrailingSpace) $ splitBy '|' rest let head = (text ".TH") <+> title' <+> section <+> diff --git a/tests/writer.man b/tests/writer.man index 5ea033fa2..07619ea5f 100644 --- a/tests/writer.man +++ b/tests/writer.man @@ -1,4 +1,4 @@ -.TH "Pandoc Test Suite" "" "July 17, 2006" +.TH Pandoc "" "July 17, 2006" "Test Suite" .PP This is a set of tests for pandoc\. Most of them are adapted from John Gruber's markdown test suite\. @@ -747,4 +747,4 @@ In quote\. .PP In list\. .SH AUTHORS -John MacFarlane, Anonymous \ No newline at end of file +John MacFarlane, Anonymous