citeproc 0.9 → 0.9.0.1
raw patch · 3 files changed
+15/−2 lines, 3 files
Files
- CHANGELOG.md +7/−0
- citeproc.cabal +1/−1
- src/Citeproc/Types.hs +7/−1
CHANGELOG.md view
@@ -1,5 +1,12 @@ # citeproc changelog +## 0.9.0.1++ * Fix `readAsInt` so it handles negative numbers in strings.+ `readAsInt` attempts to read strings as integers, but previously+ it didn't properly handle strings like `"-387"`, which are+ sometimes used in bibliographies. See jgm/pandoc#10839.+ ## 0.9 * Fix handling of `type` conditions in `if` (#151).
citeproc.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: citeproc-version: 0.9+version: 0.9.0.1 synopsis: Generates citations and bibliography from CSL styles. description: citeproc parses CSL style files and uses them to generate a list of formatted citations and bibliography
src/Citeproc/Types.hs view
@@ -1641,7 +1641,13 @@ readAsInt :: Text -> Maybe Int readAsInt t =- case TR.decimal t of+ case T.uncons t of+ Just ('-', t') -> (0 -) <$> readAsDecimal t'+ Just (c, _) | isDigit c -> readAsDecimal t+ _ -> Nothing+ where+ readAsDecimal s =+ case TR.decimal s of Right (x,t') | T.null t' -> Just x _ -> Nothing