aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2022-02-04 17:02:43 -0800
committerJohn MacFarlane <[email protected]>2022-02-04 17:02:43 -0800
commit28349447cba9262cfb9ac54122df382fcdfa92d5 (patch)
treedaf37cfb132c4e7a88fb2b16ac5f90163669c8d2
parent15316a0058ce75200ba7956a16d8a5a2bdd5563f (diff)
Docx reader: skeleton for endnote citation ADDINs.
-rw-r--r--src/Text/Pandoc/Readers/Docx.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs
index 005f3e437..42506944c 100644
--- a/src/Text/Pandoc/Readers/Docx.hs
+++ b/src/Text/Pandoc/Readers/Docx.hs
@@ -93,6 +93,8 @@ import Data.Aeson (eitherDecode)
import qualified Data.Text.Lazy as TL
import Text.Pandoc.UTF8 (fromTextLazy)
import Text.Pandoc.Citeproc.MetaValue (referenceToMetaValue)
+import Text.Pandoc.Readers.EndNote (readEndNoteXMLCitation)
+import Text.Pandoc.Sources (toSources)
readDocx :: PandocMonad m
=> ReaderOptions
@@ -457,6 +459,14 @@ parPartToInlines' (Field info children) =
case info of
HyperlinkField url -> parPartToInlines' $ ExternalHyperLink url children
PagerefField fieldAnchor True -> parPartToInlines' $ InternalHyperLink fieldAnchor children
+ EndNoteCite t -> do
+ formattedCite <- smushInlines <$> mapM parPartToInlines' children
+ opts <- asks docxOptions
+ if isEnabled Ext_citations opts
+ then do
+ _citation <- readEndNoteXMLCitation (toSources t)
+ undefined -- TODO
+ else return formattedCite
CslCitation t -> do
formattedCite <- smushInlines <$> mapM parPartToInlines' children
opts <- asks docxOptions
@@ -495,6 +505,11 @@ parPartToInlines' (Field info children) =
if isEnabled Ext_citations opts
then return mempty -- omit Zotero-generated bibliography
else smushInlines <$> mapM parPartToInlines' children
+ EndNoteRefList -> do
+ opts <- asks docxOptions
+ if isEnabled Ext_citations opts
+ then return mempty -- omit Zotero-generated bibliography
+ else smushInlines <$> mapM parPartToInlines' children
_ -> smushInlines <$> mapM parPartToInlines' children
isAnchorSpan :: Inline -> Bool