aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2022-02-01 21:40:43 -0800
committerJohn MacFarlane <[email protected]>2022-02-01 21:40:43 -0800
commit6bf683d2203abc9ba22eb0afbece0e68bdb77bd5 (patch)
treef13215dd48b5904486509c6581f67aa01f532ab6
parentb4bc7fd17bf70cb0fc3ee1e3ecad36710e2144b9 (diff)
Docx reader: parse EN.CITE and EN.REFLIST fields.endnote
-rw-r--r--src/Text/Pandoc/Readers/Docx/Fields.hs20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Docx/Fields.hs b/src/Text/Pandoc/Readers/Docx/Fields.hs
index 5707197c0..88c429ddd 100644
--- a/src/Text/Pandoc/Readers/Docx/Fields.hs
+++ b/src/Text/Pandoc/Readers/Docx/Fields.hs
@@ -28,6 +28,8 @@ data FieldInfo = HyperlinkField URL
| PagerefField Anchor Bool
| ZoteroItem T.Text
| ZoteroBibliography
+ | EndNoteCite T.Text
+ | EndNoteRefList
| UnknownField
deriving (Show)
@@ -49,10 +51,10 @@ addIn = do
spaces
string "ADDIN"
spaces
- try zoteroItem <|> zoteroBibliography
+ zoteroItem <|> zoteroBibliography <|> endnoteCite <|> endnoteRefList
zoteroItem :: Parser FieldInfo
-zoteroItem = do
+zoteroItem = try $ do
string "ZOTERO_ITEM"
spaces
string "CSL_CITATION"
@@ -60,10 +62,22 @@ zoteroItem = do
ZoteroItem <$> getInput
zoteroBibliography :: Parser FieldInfo
-zoteroBibliography = do
+zoteroBibliography = try $ do
string "ZOTERO_BIBL"
return ZoteroBibliography
+endnoteCite :: Parser FieldInfo
+endnoteCite = try $ do
+ string "EN.CITE"
+ spaces
+ EndNoteCite <$> getInput
+
+endnoteRefList :: Parser FieldInfo
+endnoteRefList = try $ do
+ string "EN.REFLIST"
+ return EndNoteRefList
+
+
escapedQuote :: Parser T.Text
escapedQuote = string "\\\"" $> "\\\""