packages feed

djot 0.1.1.2 → 0.1.1.3

raw patch · 4 files changed

+60/−3 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,11 @@ # Revision history for djot +## 0.1.1.3 -- 2024-03-17++* Ensure that tables end when we hit a blank line (#4).++* Fix parsing of table immediately after list (#4).+ ## 0.1.1.2 -- 2024-03-14  * Fix bug parsing regular paragraphs after list (#4).
djot.cabal view
@@ -1,6 +1,6 @@ cabal-version:      3.0 name:               djot-version:            0.1.1.2+version:            0.1.1.3 synopsis:           Parser and renderer for djot light markup syntax. description:        Djot (<https://djot.net>) is a light markup language.                     This package provides a data structure to represent
src/Djot/Blocks.hs view
@@ -458,7 +458,12 @@   , blockContinue = \container ->       -- TODO: this is inefficient; we parse the inline contents       -- twice. Find a better way.-      (True <$ lookahead pRawTableRow)+      (True <$+          -- if we just parsed a blank or caption line,+          -- we don't allow more table rows:+          case Seq.viewr (containerText container) of+              _ Seq.:> c | not (B8.any (=='|') (chunkBytes c)) -> mzero+              _ -> lookahead pRawTableRow)       <|> (True <$ followedByBlankLine)       <|> (True <$ lookahead                       (skipMany spaceOrTab *> asciiChar '^' *> spaceOrTab))@@ -1017,7 +1022,7 @@         '`' -> blockStart codeBlockSpec         '{' -> blockStart attrSpec         '[' -> blockStart referenceDefinitionSpec <|> blockStart footnoteSpec-        '|' | bt == Normal -> blockStart tableSpec+        '|' | bt /= CaptionBlock -> blockStart tableSpec         '^' | bt == CaptionBlock -> blockStart captionSpec         _ -> blockStart listItemSpec       True <$ tryContainerStarts) <|> pure False
test/regression.test view
@@ -118,3 +118,49 @@ </ol> <p>ok</p> ```++```+1. one+2. two++|three|four|++five+.+<ol>+<li>+one+</li>+<li>+two+</li>+</ol>+<table>+<tr>+<td>three</td>+<td>four</td>+</tr>+</table>+<p>five</p>+```++```+|one|two|three|++|four|five|six|+.+<table>+<tr>+<td>one</td>+<td>two</td>+<td>three</td>+</tr>+</table>+<table>+<tr>+<td>four</td>+<td>five</td>+<td>six</td>+</tr>+</table>+```