diff options
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/OpenDocument.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index 6fd0dd5dd..c6b66382b 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -28,6 +28,7 @@ import Text.Pandoc.BCP47 (Lang (..), parseBCP47) import Text.Pandoc.Class.PandocMonad (PandocMonad, report, translateTerm, setTranslations, toLang) import Text.Pandoc.Definition +import qualified Text.Pandoc.Builder as B import Text.Pandoc.Logging import Text.Pandoc.Options import Text.DocLayout @@ -223,12 +224,18 @@ writeOpenDocument opts (Pandoc meta blocks) = do let colwidth = if writerWrapText opts == WrapAuto then Just $ writerColumns opts else Nothing + let meta' = case lookupMetaBlocks "abstract" meta of + [] -> meta + xs -> B.setMeta "abstract" + (B.divWith ("",[],[("custom-style","Abstract")]) + (B.fromList xs)) + meta ((body, metadata),s) <- flip runStateT defaultWriterState $ do m <- metaToContext opts (blocksToOpenDocument opts) (fmap chomp . inlinesToOpenDocument opts) - meta + meta' b <- blocksToOpenDocument opts blocks return (b, m) let styles = stTableStyles s ++ stParaStyles s ++ formulaStyles ++ |