packages feed

commonmark 0.2.1 → 0.2.1.1

raw patch · 4 files changed

+14/−9 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

changelog.md view
@@ -1,5 +1,9 @@ # Changelog for commonmark +## 0.2.1.1++  * Fix bug in `prettyShow` for `SourceRange` (#80).+    The bug led to an infinite loop in certain cases.  ## 0.2.1 
commonmark.cabal view
@@ -1,6 +1,6 @@ cabal-version:  2.2 name:           commonmark-version:        0.2.1+version:        0.2.1.1 synopsis:       Pure Haskell commonmark parser. description:    This library provides the core data types and functions
src/Commonmark/Blocks.hs view
@@ -403,6 +403,8 @@    where      go [] = []      go ((!startpos1, !endpos1):(!startpos2, !endpos2):rest)+       | startpos1 == startpos2+       , endpos1 == endpos2   = go ((startpos1, endpos2):rest)        | endpos1 == startpos2 = go ((startpos1, endpos2):rest)      go (x:xs) = x : go xs 
src/Commonmark/Types.hs view
@@ -125,20 +125,19 @@   ranged :: SourceRange -> a -> a  prettyRange :: SourceRange -> String-prettyRange (SourceRange []) = ""-prettyRange (SourceRange xs@((p,_):_)) =-  sourceName p ++ "@" ++ go (sourceName p) xs+prettyRange (SourceRange xs) = go "" xs   where     go _ [] = ""     go curname ((p1,p2):rest)-      | sourceName p1 /= curname =-         sourceName p1 ++ "@" ++ go (sourceName p) ((p1,p2):rest)-      | otherwise =+      = (if sourceName p1 /= curname+            then sourceName p1 ++ "@"+            else "") ++          show (sourceLine p1) ++ ":" ++          show (sourceColumn p1) ++ "-" ++-         (if sourceName p2 /= curname+         (if sourceName p2 /= sourceName p1              then sourceName p2 ++ "@"-             else "") ++ show (sourceLine p2) +++             else "") +++         show (sourceLine p2) ++          ":" ++ show (sourceColumn p2) ++          if null rest             then ""