diff options
| author | John MacFarlane <[email protected]> | 2022-01-19 10:20:15 -0800 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2022-01-19 10:20:15 -0800 |
| commit | 73fe7c129e065bb5852def89a83bf8a6e474dc7e (patch) | |
| tree | 67aa6ff08e184cd1a171478a7e490de9ca0fdd7b /src/Text | |
| parent | 6723891c722a758d8d7aef094c435c9f8daa60e9 (diff) | |
Docx reader: add skeleton for parsing zotero ADDINs.
So far this just adds a constructor for FieldInfo;
we'll need to adjust the rest of the reader code to
parse the JSON and do something with it.
See #7840.
Diffstat (limited to 'src/Text')
| -rw-r--r-- | src/Text/Pandoc/Readers/Docx/Fields.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Docx/Fields.hs b/src/Text/Pandoc/Readers/Docx/Fields.hs index 5f090b6be..4d7bc3757 100644 --- a/src/Text/Pandoc/Readers/Docx/Fields.hs +++ b/src/Text/Pandoc/Readers/Docx/Fields.hs @@ -26,6 +26,7 @@ type Anchor = T.Text data FieldInfo = HyperlinkField URL -- The boolean indicates whether the field is a hyperlink. | PagerefField Anchor Bool + | ZoteroField T.Text | UnknownField deriving (Show) @@ -38,8 +39,21 @@ fieldInfo = <|> try ((uncurry PagerefField) <$> pageref) <|> + try (ZoteroField <$> zotero) + <|> return UnknownField +zotero :: Parser T.Text +zotero = do + spaces + string "ADDIN" + spaces + string "ZOTERO_ITEM" + spaces + string "CSL_CITATION" + spaces + getInput + escapedQuote :: Parser T.Text escapedQuote = string "\\\"" $> "\\\"" |
