diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-11-02 12:05:56 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-11-02 12:05:56 +0100 |
commit | 705df61198f6cab21f81b6aba191d6602bf14fdc (patch) | |
tree | 892791f17369fac2b3a069845a9ab54dd7b15aea /src | |
parent | eb5cb0f30401b02e9ad78a8523299e33e8859fee (diff) | |
download | pandoc-705df61198f6cab21f81b6aba191d6602bf14fdc.tar.gz |
LaTeX reader: Handle BVerbatim from fancyvrb. Fixes #3203.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 6fa4fb8b8..ab7aabab1 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -949,8 +949,8 @@ verbatimEnv' = fmap snd <$> withRaw $ try $ do string "\\begin" name <- braced' - guard $ name `elem` ["verbatim", "Verbatim", "lstlisting", - "minted", "alltt", "comment"] + guard $ name `elem` ["verbatim", "Verbatim", "BVerbatim", + "lstlisting", "minted", "alltt", "comment"] manyTill anyChar (try $ string $ "\\end{" ++ name ++ "}") blob' :: IncludeParser @@ -1105,14 +1105,8 @@ environments = M.fromList verbEnv "code")) , ("comment", mempty <$ verbEnv "comment") , ("verbatim", codeBlock <$> verbEnv "verbatim") - , ("Verbatim", do options <- option [] keyvals - let kvs = [ (if k == "firstnumber" - then "startFrom" - else k, v) | (k,v) <- options ] - let classes = [ "numberLines" | - lookup "numbers" options == Just "left" ] - let attr = ("",classes,kvs) - codeBlockWith attr <$> verbEnv "Verbatim") + , ("Verbatim", fancyverbEnv "Verbatim") + , ("BVerbatim", fancyverbEnv "BVerbatim") , ("lstlisting", do options <- option [] keyvals let kvs = [ (if k == "firstnumber" then "startFrom" @@ -1223,6 +1217,17 @@ verbEnv name = do res <- manyTill anyChar endEnv return $ stripTrailingNewlines res +fancyverbEnv :: String -> LP Blocks +fancyverbEnv name = do + options <- option [] keyvals + let kvs = [ (if k == "firstnumber" + then "startFrom" + else k, v) | (k,v) <- options ] + let classes = [ "numberLines" | + lookup "numbers" options == Just "left" ] + let attr = ("",classes,kvs) + codeBlockWith attr <$> verbEnv name + orderedList' :: LP Blocks orderedList' = do optional sp |