aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2022-02-01 21:40:43 -0800
committerJohn MacFarlane <[email protected]>2022-02-04 10:04:16 -0800
commitd164e5bb1d3106e81bc886fd41a849f080f03c8c (patch)
treee561deeaae9437deeea29086ff3533c45910fa1e
parent34897031f4df5980cd529f82bc7827d4cb468dd0 (diff)
Docx reader: parse EN.CITE and EN.REFLIST fields.
-rw-r--r--src/Text/Pandoc/Readers/Docx/Fields.hs18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Docx/Fields.hs b/src/Text/Pandoc/Readers/Docx/Fields.hs
index a53ef35ea..4cb89ac0c 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
| CslCitation T.Text
| CslBibliography
+ | EndNoteCite T.Text
+ | EndNoteRefList
| UnknownField
deriving (Show)
@@ -38,7 +40,7 @@ fieldInfo :: Parser FieldInfo
fieldInfo =
try (HyperlinkField <$> hyperlink)
<|>
- try ((uncurry PagerefField) <$> pageref)
+ try ((uncurry PagerefField) <$> pageref)
<|>
try addIn
<|>
@@ -49,7 +51,7 @@ addIn = do
spaces
string "ADDIN"
spaces
- try cslCitation <|> cslBibliography
+ try cslCitation <|> cslBibliography <|> endnoteCite <|> endnoteRefList
cslCitation :: Parser FieldInfo
cslCitation = do
@@ -64,6 +66,18 @@ cslBibliography = do
string "ZOTERO_BIBL" <|> string "Mendeley Bibliography CSL_BIBLIOGRAPHY"
return CslBibliography
+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 "\\\"" $> "\\\""