diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-06-23 11:12:40 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-06-23 11:12:40 -0700 |
commit | 9b7282bb0f27546354b777d2174c26fb88c8e110 (patch) | |
tree | 5700745d571e75cd19599f3a8b28b87a5dd2acbc /src | |
parent | 3b25511e47a246e7ab210a086baf7dd56fbf1f2a (diff) | |
download | pandoc-9b7282bb0f27546354b777d2174c26fb88c8e110.tar.gz |
LaTeX reader: Retain the Div around tables with attributes.
We'll need this to store table attributes until all writers
are adjusted to react to attributes on the Table element.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 05abfe6fb..c47c88965 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -2433,9 +2433,16 @@ addTableCaption = walkM go ((_,classes,kvs), Just ident) -> (ident,classes,kvs) _ -> attr - return $ Table attr' capt spec th tb tf + return $ addAttrDiv attr' $ Table nullAttr capt spec th tb tf go x = return x +-- TODO: For now we add a Div to contain table attributes, since +-- most writers don't do anything yet with attributes on Table. +-- This can be removed when that changes. +addAttrDiv :: Attr -> Block -> Block +addAttrDiv ("",[],[]) b = b +addAttrDiv attr b = Div attr [b] + block :: PandocMonad m => LP m Blocks block = do res <- (mempty <$ spaces1) |