citation-resolve 0.4.2.1 → 0.4.2.2
raw patch · 2 files changed
+10/−5 lines, 2 files
Files
citation-resolve.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: citation-resolve-version: 0.4.2.1+version: 0.4.2.2 synopsis: convert document IDs such as DOI, ISBN, arXiv ID to bibliographic reference. description: This modules provides a way to convert document identifiers, such@@ -60,7 +60,6 @@ , download-curl >= 0.1.4 , either >= 3.4.1 , lens >= 3.9.0.2- , MissingH >= 1.1 , mtl >= 2.1.2 -- , hxt >= 9.3.1 -- TODO: treat xsl more properly -- , hxt-xslt >= 9.1.1 -- using these libraries.
src/Text/CSL/Input/Identifier/Internal.hs view
@@ -26,7 +26,6 @@ import Data.List (span) import qualified Data.Map.Strict as Map import qualified Data.Text as Text-import qualified Data.String.Utils as String (replace) import qualified Data.Yaml as Yaml import Network.Curl.Download (openURIWithOpts) import Network.Curl.Opts (CurlOption(CurlFollowLocation, CurlHttpHeaders))@@ -160,7 +159,7 @@ bs <- liftIOE $ openURIWithOpts opts url return $ unlines . drop 2 . filter (any (not . isSpace)) . lines $- String.replace "adsurl" "url" $+ stringReplace "adsurl" "url" $ BS.unpack bs resolveBibcode :: MonadIO m => RM m String String@@ -171,7 +170,7 @@ bs <- liftIOE $ openURIWithOpts opts url return $ unlines . drop 2 . filter (any (not . isSpace)) . lines $- String.replace "adsurl" "url" $ BS.unpack bs+ stringReplace "adsurl" "url" $ BS.unpack bs resolveISBN :: MonadIO m => RM m String String resolveISBN docIDStr = do@@ -202,3 +201,10 @@ dd <- Paths.getDataDir createDirectoryIfMissing True dd Paths.getDataFileName fn++-- | String version of replace.++stringReplace :: String -> String -> String -> String+stringReplace a b c = + Text.unpack $+ Text.replace (Text.pack a) (Text.pack b) (Text.pack c)