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.
This commit is contained in:
parent
6723891c72
commit
73fe7c129e
1 changed files with 14 additions and 0 deletions
|
@ -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 "\\\"" $> "\\\""
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue