commonmark 0.1.1 → 0.1.1.1
raw patch · 3 files changed
+11/−7 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- changelog.md +5/−0
- commonmark.cabal +1/−1
- src/Commonmark/Inlines.hs +5/−6
changelog.md view
@@ -1,5 +1,10 @@ # Changelog for commonmark +## 0.1.1.1++* Fixed corner case with link suffix parsing, which could result+ in dropped tokens in certain cases (#65).+ ## 0.1.1 * Export `reverseSubforests` from `Commonmark.Blocks` [API change] (#64).
commonmark.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: commonmark-version: 0.1.1+version: 0.1.1.1 synopsis: Pure Haskell commonmark parser. description: This library provides the core data types and functions
src/Commonmark/Inlines.hs view
@@ -42,7 +42,7 @@ import Data.Char (isAscii, isLetter) import qualified Data.IntMap.Strict as IntMap import qualified Data.Map.Strict as M-import Data.Maybe (isJust, mapMaybe)+import Data.Maybe (isJust, mapMaybe, listToMaybe) import qualified Data.Set as Set #if !MIN_VERSION_base(4,11,0) import Data.Monoid ((<>))@@ -792,16 +792,15 @@ eltchunk = Chunk (Parsed elt) openerPos elttoks afterchunks = dropWhile ((< newpos) . chunkPos) (afters right)- afterchunkpos = case afterchunks of- [] -> newpos- (ch:_) -> chunkPos ch+ firstAfterTokPos = tokPos <$> listToMaybe+ (concatMap chunkToks afterchunks) -- in the event that newpos is not at the -- beginning of a chunk, we need to add -- some tokens from that chunk... missingtoks = [t | t <- suffixToks- , tokPos t < afterchunkpos- , tokPos t >= newpos]+ , tokPos t >= newpos+ , maybe True (< newpos) firstAfterTokPos] addMissing = if null missingtoks then id