mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-25 01:36:45 +00:00
Docx writer: separate adjacent tables.
Word combines adjacent tables, so to prevent this we insert an empty paragraph between two adjacent tables. Closes #4315.
This commit is contained in:
@@ -848,7 +848,15 @@ writeOpenXML opts (Pandoc meta blocks) = do
|
||||
|
||||
-- | Convert a list of Pandoc blocks to OpenXML.
|
||||
blocksToOpenXML :: (PandocMonad m) => WriterOptions -> [Block] -> WS m [Element]
|
||||
blocksToOpenXML opts bls = concat `fmap` mapM (blockToOpenXML opts) bls
|
||||
blocksToOpenXML opts = fmap concat . mapM (blockToOpenXML opts) . separateTables
|
||||
|
||||
-- Word combines adjacent tables unless you put an empty paragraph between
|
||||
-- them. See #4315.
|
||||
separateTables :: [Block] -> [Block]
|
||||
separateTables [] = []
|
||||
separateTables (x@Table{}:y@Table{}:zs) =
|
||||
x : RawBlock (Format "openxml") "<w:p />" : separateTables (y:zs)
|
||||
separateTables (x:xs) = x : separateTables xs
|
||||
|
||||
pStyleM :: (PandocMonad m) => ParaStyleName -> WS m XML.Element
|
||||
pStyleM styleName = do
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user