@@ -99,8 +99,8 @@ getNoteCitations needNote
9999 in queryWith getCitation . getCits
100100
101101setHash :: Citation -> IO Citation
102−setHash (Citation i p l cm nn _)
103− = hashUnique `fmap` newUnique >>= return . Citation i p l cm nn
102+setHash (Citation i p s l cm nn _)
103+ = hashUnique `fmap` newUnique >>= return . Citation i p s l cm nn
104104
105105generateNotes :: [Inline] -> Pandoc -> Pandoc
106106generateNotes needNote = processWith (mvCiteInNote needNote)
@@ -150,19 +150,30 @@ setCiteNoteNum _ _ = []
150150setCitationNoteNum :: Int -> [Citation] -> [Citation]
151151setCitationNoteNum i = map $ \c -> c { citationNoteNum = i}
152152
153+-- a temporary function to tide us over until citeproc is
154+-- changed to use Inline lists for prefixes and suffixes...
155+stringify :: [Inline] -> String
156+stringify = queryWith go
157+ where go :: Inline -> [Char]
158+ go Space = " "
159+ go (Str x) = x
160+ go (Code x) = x
161+ go _ = ""
162+
153163toCslCite :: Citation -> CSL.Cite
154−toCslCite (Citation i p l cm nn h)
155− = let (la,lo) = parseLocator l
156− citMode = case cm of
164+toCslCite c
165+ = let (la,lo) = parseLocator $ citationLocator c
166+ citMode = case citationMode c of
157167 AuthorInText -> (True, False)
158168 SuppressAuthor -> (False,True )
159169 NormalCitation -> (False,False)
160− in emptyCite { CSL.citeId = i
161− , CSL.citePrefix = p
170+ in emptyCite { CSL.citeId = citationId c
171+ , CSL.citePrefix = stringify $ citationPrefix c
172+ , CSL.citeSuffix = stringify $ citationSuffix c
162173 , CSL.citeLabel = la
163174 , CSL.citeLocator = lo
164− , CSL.citeNoteNumber = show nn
175+ , CSL.citeNoteNumber = show $ citationNoteNum c
165176 , CSL.authorInText = fst citMode
166177 , CSL.suppressAuthor = snd citMode
167− , CSL.citeHash = h
178+ , CSL.citeHash = citationHash c
168179 }