diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-01-01 08:46:45 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-01-01 08:46:45 -0800 |
commit | e7187fa3bb5e704b8a4a96f8de952636de4eee3e (patch) | |
tree | a804ddacaccb739cee4f4f35bec12d53f508a2f3 /src/Text/Pandoc | |
parent | 52310eb4708f0737ad87ac5f1217571b3dc73a78 (diff) | |
download | pandoc-e7187fa3bb5e704b8a4a96f8de952636de4eee3e.tar.gz |
LaTeX reader: handle `tabular*` environment.
This change allows pandoc not to choke on the table-width parameter
of `tabular*`. Note that the table width is not actually parsed
or taken into account, but this should give tolerable results in
many cases.
Closes #1850.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 97a4e1225..8b3743bca 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1018,7 +1018,8 @@ environments = M.fromList , ("center", env "center" blocks) , ("table", env "table" $ resetCaption *> skipopts *> blocks >>= addTableCaption) - , ("tabular", env "tabular" simpTable) + , ("tabular*", env "tabular" $ simpTable True) + , ("tabular", env "tabular" $ simpTable False) , ("quote", blockQuote <$> env "quote" blocks) , ("quotation", blockQuote <$> env "quotation" blocks) , ("verse", blockQuote <$> env "verse" blocks) @@ -1304,8 +1305,9 @@ parseTableRow cols = try $ do spaces return cells'' -simpTable :: LP Blocks -simpTable = try $ do +simpTable :: Bool -> LP Blocks +simpTable hasWidthParameter = try $ do + when hasWidthParameter $ () <$ (spaces >> tok) spaces aligns <- parseAligns let cols = length aligns |