mmark 0.0.5.4 → 0.0.5.5
raw patch · 5 files changed
+19/−11 lines, 5 filesdep ~aesondep ~criterionPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson, criterion
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- README.md +1/−1
- Text/MMark/Parser.hs +4/−4
- mmark.cabal +1/−1
- tests/Text/MMarkSpec.hs +8/−5
CHANGELOG.md view
@@ -1,3 +1,8 @@+## MMark 0.0.5.5++* Fixed the bug in parser which signalled a parse error when YAML block was+ followed by more than one newline without markdown content after it.+ ## MMark 0.0.5.4 * Empty autolinks are now disallowed. `<>` will result in literal `<>` in
README.md view
@@ -226,7 +226,7 @@ starts. Content belonging to a particular list or block quote should start at the same column (or greater column, up to the column where indented code blocks start). As a consequence of this, block quotes do not feature- “laziness”+ “laziness”. * Block quotes are started by a single `>` character, it's not necessary to put a `>` character at beginning of every line belonging to a quote (in fact, this would make every line a separate block quote).
Text/MMark/Parser.hs view
@@ -136,14 +136,14 @@ pYamlBlock = do dpos <- getPosition string "---" *> sc' *> eol- let go = do+ let go acc = do l <- takeWhileP Nothing notNewline void (optional eol) e <- atEnd if e || T.stripEnd l == "---"- then return []- else (l :) <$> go- ls <- go+ then return acc+ else go (acc . (l:))+ ls <- go id <*> ([] <$ sc) return $ case (Yaml.decodeEither . TE.encodeUtf8 . T.intercalate "\n") ls of Left err' ->
mmark.cabal view
@@ -1,5 +1,5 @@ name: mmark-version: 0.0.5.4+version: 0.0.5.5 cabal-version: >= 1.18 tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.2 license: BSD3
tests/Text/MMarkSpec.hs view
@@ -1973,12 +1973,15 @@ doc <- mkDoc "Here we go." MMark.projectYaml doc `shouldBe` Nothing context "when document contains a YAML section" $ do- context "when it is valid" $- it "returns the YAML section" $ do+ context "when it is valid" $ do+ let r = object+ [ "x" .= Number 100+ , "y" .= Number 200 ]+ it "returns the YAML section (1)" $ do doc <- mkDoc "---\nx: 100\ny: 200\n---\nHere we go."- let r = object- [ "x" .= Number 100- , "y" .= Number 200 ]+ MMark.projectYaml doc `shouldBe` Just r+ it "returns the YAML section (2)" $ do+ doc <- mkDoc "---\nx: 100\ny: 200\n---\n\n" MMark.projectYaml doc `shouldBe` Just r context "when it is invalid" $ do let mappingErr = fancy . ErrorCustom . YamlParseError $