diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-06-02 10:17:19 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-06-02 10:17:19 +0200 |
commit | 18f86a0c02da887ad0a61dfe449e58aa7fda294c (patch) | |
tree | 41e1a22f5ff2a818dd11de883262a56cc0f7110f /src/Text | |
parent | a063ba58fddbe7f7ac8ef55cae9f5db4d841e8d3 (diff) | |
download | pandoc-18f86a0c02da887ad0a61dfe449e58aa7fda294c.tar.gz |
Fixed keywords in docx writer.
(See #3719)
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/Docx.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index c68e90049..63bb8a5ae 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -496,6 +496,11 @@ writeDocx opts doc@(Pandoc meta _) = do , qName (elName e) == "abstractNum" ] ++ [Elem e | e <- allElts , qName (elName e) == "num" ] } + + let keywords = case lookupMeta "keywords" meta of + Just (MetaList xs) -> map stringify xs + _ -> [] + let docPropsPath = "docProps/core.xml" let docProps = mknode "cp:coreProperties" [("xmlns:cp","http://schemas.openxmlformats.org/package/2006/metadata/core-properties") @@ -505,7 +510,7 @@ writeDocx opts doc@(Pandoc meta _) = do ,("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance")] $ mknode "dc:title" [] (stringify $ docTitle meta) : mknode "dc:creator" [] (intercalate "; " (map stringify $ docAuthors meta)) - : mknode "cp:keywords" [] (intercalate ", " (map stringify $ docKeywords meta)) + : mknode "cp:keywords" [] (intercalate ", " keywords) : (\x -> [ mknode "dcterms:created" [("xsi:type","dcterms:W3CDTF")] x , mknode "dcterms:modified" [("xsi:type","dcterms:W3CDTF")] x ]) (formatTime defaultTimeLocale "%FT%XZ" utctime) |