summaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2023-06-07 09:08:53 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2023-06-07 09:08:53 -0700
commit0166aecaab1dfe050ea9ec780833a892c54060e9 (patch)
tree5f200e3818d2ccb8b659ef619f450af352ce08bb /src/Text
parentd04838b678c037fbf966504d8f29200e09b21aa5 (diff)
Allow `abstract-title` to be specified in docx metadata.
Closes #8794.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index e39dcb648..47a8d9bfc 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -769,7 +769,11 @@ writeOpenXML opts (Pandoc meta blocks) = do
abstract <- if null abstract'
then return []
else do
- abstractTitle <- translateTerm Abstract
+ abstractTitle <- case lookupMeta "abstract-title" meta of
+ Just (MetaBlocks bs) -> pure $ stringify bs
+ Just (MetaInlines ils) -> pure $ stringify ils
+ Just (MetaString s) -> pure s
+ _ -> translateTerm Abstract
abstractTit <- withParaPropM (pStyleM "AbstractTitle") $
blocksToOpenXML opts
[Para [Str abstractTitle]]