@@ -84,7 +84,11 @@ processCitations (Pandoc meta bs) = do
8484 <> "\n" <> T.pack err
8585 Right abbr -> return $ Just abbr
8686
87− let getParentStyle url = UTF8.toText . fst <$> fetchItem url
87+ let getParentStyle url = do
88+ -- first, try to retrieve the style locally, then use HTTP.
89+ let basename = T.takeWhileEnd (/='/') url
90+ UTF8.toText <$>
91+ catchError (getFile ".csl" basename) (\_ -> fst <$> fetchItem url)
8892
8993 -- TODO check .csl directory if not found
9094 styleRes <- Citeproc.parseStyle getParentStyle cslContents