diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Man.hs | 10 | ||||
-rw-r--r-- | test/grofftest.sh | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs index 9802216c6..aea53a375 100644 --- a/src/Text/Pandoc/Readers/Man.hs +++ b/src/Text/Pandoc/Readers/Man.hs @@ -182,7 +182,8 @@ escapeLexer = do let skipSeqs = ["%", "{", "}", "&", "\n", ":", "\"", "0", "c"] subsSeqs = [ ("-", '-'), (" ", ' '), ("\\", '\\'), ("[lq]", '“'), ("[rq]", '”') , ("[em]", '—'), ("[en]", '–'), ("*(lq", '«'), ("*(rq", '»') - , ("t", '\t'), ("e", '\\'), ("`", '`') ] + , ("t", '\t'), ("e", '\\'), ("`", '`'), ("^", ' '), ("|", ' ') + , ("'", '`') ] substitute :: PandocMonad m => (String,Char) -> ManLexer m EscapeThing substitute (from,to) = try $ string from >> return (EChar to) skip :: PandocMonad m => String -> ManLexer m EscapeThing @@ -219,7 +220,7 @@ escapeLexer = do escUnknown = do c <- anyChar pos <- getPosition - logOutput $ SkippedContent ("Unknown escape seq \\" ++ [c]) pos + logOutput $ SkippedContent ("Unknown escape sequence \\" ++ [c]) pos return ENothing currentFont :: PandocMonad m => ManLexer m FontKind @@ -240,7 +241,7 @@ lexMacro :: PandocMonad m => ManLexer m ManToken lexMacro = do char '.' <|> char '\'' many spacetab - macroName <- many1 (letter <|> oneOf ['\\', '"']) + macroName <- many1 (letter <|> oneOf ['\\', '"', '&']) args <- lexArgs let joinedArgs = unwords $ fst <$> args knownMacro mkind = MMacro mkind args @@ -269,7 +270,8 @@ lexMacro = do -- TODO better would be [[RoffStr]], since one arg may have different fonts lexArgs :: PandocMonad m => ManLexer m [RoffStr] lexArgs = do - args <- many oneArg + args <- many $ try oneArg + many spacetab eofline return args diff --git a/test/grofftest.sh b/test/grofftest.sh index 2c559d21a..ca1aa71d9 100644 --- a/test/grofftest.sh +++ b/test/grofftest.sh @@ -13,9 +13,9 @@ DIR=$2 $PANDOC --version > /dev/null || { echo "pandoc executable error" >&2 ; exit 1 ; } -ls $2 | egrep "^.+\.[0-9]$" | while read f ; do +ls $2 | egrep "^.+\.[0-9].?$" | while read f ; do FILE="$DIR/$f" - $PANDOC -f man -t native < $FILE > /dev/null + $PANDOC -f man -t native < $FILE 2>&1 > /dev/null if [ $? -ne 0 ]; then echo "Failed to convert $FILE" fi |