diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2022-02-04 23:51:12 -0800 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2022-02-04 23:51:12 -0800 |
| commit | d40d94ebd9919802267159c0d753d90cca36b1dc (patch) | |
| tree | bd4527e541f2b1b4a3ad573d3cbb8b17eb44475c | |
| parent | f813aca3ea15e8f677f157725e86fcc92f3a1aa1 (diff) | |
EndNote reader: add nocite as the other bib format readers do.
| -rw-r--r-- | src/Text/Pandoc/Readers/EndNote.hs | 10 | ||||
| -rw-r--r-- | test/endnotexml-reader.native | 17 |
2 files changed, 25 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/EndNote.hs b/src/Text/Pandoc/Readers/EndNote.hs index 0ad5a117e..586dcf451 100644 --- a/src/Text/Pandoc/Readers/EndNote.hs +++ b/src/Text/Pandoc/Readers/EndNote.hs @@ -61,7 +61,15 @@ readEndNoteXML :: (PandocMonad m, ToSources a) readEndNoteXML _opts inp = do let sources = toSources inp refs <- readEndNoteXMLReferences sources >>= mapM (traverse (return . text)) - return $ setMeta "references" (map referenceToMetaValue refs) $ B.doc mempty + return $ + setMeta "nocite" (cite [Citation {citationId = "*" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0}] (str "[@*]")) $ + setMeta "references" (map referenceToMetaValue refs) $ + B.doc mempty readEndNoteXMLCitation :: PandocMonad m => Sources -> m (Citeproc.Citation Text) diff --git a/test/endnotexml-reader.native b/test/endnotexml-reader.native index 6e346e9fb..3ff412da6 100644 --- a/test/endnotexml-reader.native +++ b/test/endnotexml-reader.native @@ -2,7 +2,22 @@ Pandoc Meta { unMeta = fromList - [ ( "references" + [ ( "nocite" + , MetaInlines + [ Cite + [ Citation + { citationId = "*" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + ] + [ Str "[@*]" ] + ] + ) + , ( "references" , MetaList [ MetaMap (fromList |
