Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc-commonmark-extensions for 
openSUSE:Factory checked in at 2022-08-01 21:29:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-commonmark-extensions (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-commonmark-extensions.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-commonmark-extensions"

Mon Aug  1 21:29:41 2022 rev:8 rq:987029 version:0.2.3.2

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/ghc-commonmark-extensions/ghc-commonmark-extensions.changes
      2022-02-11 23:10:37.635157294 +0100
+++ 
/work/SRC/openSUSE:Factory/.ghc-commonmark-extensions.new.1533/ghc-commonmark-extensions.changes
    2022-08-01 21:29:46.629549432 +0200
@@ -1,0 +2,25 @@
+Tue May 31 18:23:50 UTC 2022 - Peter Simons <[email protected]>
+
+- Update commonmark-extensions to version 0.2.3.2.
+  ## 0.2.3.2
+
+  - Update lower version bounds for commonmark (#93, David
+    Thrane Christiansen).
+
+-------------------------------------------------------------------
+Sat Apr  2 21:26:16 UTC 2022 - Peter Simons <[email protected]>
+
+- Update commonmark-extensions to version 0.2.3.1.
+  ## 0.2.3.1
+
+  - `math` extension:  don't fail when display math contains
+    embedded inline math.  See jgm/pandoc#7942.
+  - Make math parsing more sophisticated.
+    Count embeddings inside `{..}`, since math can contain
+    e.g. `\text{...}` which itself contains math delimiters.
+  - Small improvement in pipe table parsing.
+    The old parser failed on some edge cases with extra whitespace
+    after pipes (which we should just ignore).
+  - `fancy_list` extension: improve list type ambiguity resolution (#89).
+
+-------------------------------------------------------------------

Old:
----
  commonmark-extensions-0.2.3.tar.gz

New:
----
  commonmark-extensions-0.2.3.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-commonmark-extensions.spec ++++++
--- /var/tmp/diff_new_pack.Hux3Hg/_old  2022-08-01 21:29:47.249551211 +0200
+++ /var/tmp/diff_new_pack.Hux3Hg/_new  2022-08-01 21:29:47.253551222 +0200
@@ -19,7 +19,7 @@
 %global pkg_name commonmark-extensions
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        0.2.3
+Version:        0.2.3.2
 Release:        0
 Summary:        Pure Haskell commonmark parser
 License:        BSD-3-Clause

++++++ commonmark-extensions-0.2.3.tar.gz -> 
commonmark-extensions-0.2.3.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/commonmark-extensions-0.2.3/changelog.md 
new/commonmark-extensions-0.2.3.2/changelog.md
--- old/commonmark-extensions-0.2.3/changelog.md        2022-01-12 
18:28:16.000000000 +0100
+++ new/commonmark-extensions-0.2.3.2/changelog.md      2022-05-31 
19:54:59.000000000 +0200
@@ -1,5 +1,22 @@
 # Changelog for commonmark-extensions
 
+## 0.2.3.2
+
+- Update lower version bounds for commonmark (#93, David
+  Thrane Christiansen).
+
+## 0.2.3.1
+
+- `math` extension:  don't fail when display math contains
+  embedded inline math.  See jgm/pandoc#7942.
+- Make math parsing more sophisticated.
+  Count embeddings inside `{..}`, since math can contain
+  e.g. `\text{...}` which itself contains math delimiters.
+- Small improvement in pipe table parsing.
+  The old parser failed on some edge cases with extra whitespace
+  after pipes (which we should just ignore).
+- `fancy_list` extension: improve list type ambiguity resolution (#89).
+
 ## 0.2.3
 
 - Allow bare word attribute in fenced_divs (#84).  This follows a similar
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commonmark-extensions-0.2.3/commonmark-extensions.cabal 
new/commonmark-extensions-0.2.3.2/commonmark-extensions.cabal
--- old/commonmark-extensions-0.2.3/commonmark-extensions.cabal 2022-01-12 
18:28:27.000000000 +0100
+++ new/commonmark-extensions-0.2.3.2/commonmark-extensions.cabal       
2022-05-31 19:53:56.000000000 +0200
@@ -1,5 +1,5 @@
 name:           commonmark-extensions
-version:        0.2.3
+version:        0.2.3.2
 synopsis:       Pure Haskell commonmark parser.
 description:
    This library provides some useful extensions to core commonmark
@@ -59,7 +59,7 @@
     , transformers
     , filepath
     , network-uri
-    , commonmark >= 0.2 && < 0.3
+    , commonmark >= 0.2.2 && < 0.3
     -- for extensions:
     , emojis >= 0.1 && < 0.2
   exposed-modules:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commonmark-extensions-0.2.3/src/Commonmark/Extensions/FancyList.hs 
new/commonmark-extensions-0.2.3.2/src/Commonmark/Extensions/FancyList.hs
--- old/commonmark-extensions-0.2.3/src/Commonmark/Extensions/FancyList.hs      
2022-01-12 04:38:14.000000000 +0100
+++ new/commonmark-extensions-0.2.3.2/src/Commonmark/Extensions/FancyList.hs    
2022-02-28 06:37:07.000000000 +0100
@@ -29,23 +29,48 @@
 
 fancyOrderedListMarker :: Monad m => BlockParser m il bl ListType
 fancyOrderedListMarker = do
-  initialParen <- option False $ True <$ symbol '('
-  (start, enumtype) <- pDecimal <|>
-                       pLowerRoman <|> pUpperRoman <|>
-                       pLowerAlpha <|> pUpperAlpha
-  delimtype <- if initialParen
-                  then TwoParens <$ symbol ')'
-                  else Period <$ symbol '.' <|> OneParen <$ symbol ')'
-  when (delimtype == Period &&
-        (enumtype == UpperRoman || enumtype == UpperAlpha)) $ do
-    Tok tt _ t <- lookAhead anyTok
-    guard $ case tt of
-              Spaces  -> T.length t > 1
-              LineEnd -> True
-              _       -> False
-  return $! OrderedList start enumtype delimtype
+  mbListType <- getParentListType
+  -- first try to parse an item like the parent
+  let pInSeries = case mbListType of
+                     Just (OrderedList _ e d) -> try (pMarker e d)
+                     _ -> mzero
+  pInSeries <|>
+      do initialParen <- option False $ True <$ symbol '('
+         (start, enumtype) <- pDecimal <|>
+                              (case mbListType of
+                                 Nothing -> pLowerRomanOne <|> pUpperRomanOne
+                                 _ -> mzero) <|>
+                              pLowerAlpha <|> pUpperAlpha <|>
+                              pLowerRoman <|> pUpperRoman
+         delimtype <- if initialParen
+                         then TwoParens <$ symbol ')'
+                         else Period <$ symbol '.' <|> OneParen <$ symbol ')'
+         when (delimtype == Period &&
+              (enumtype == UpperRoman || enumtype == UpperAlpha)) $ checkSpace
+         return $! OrderedList start enumtype delimtype
 
   where
+    checkSpace = do
+        Tok tt _ t <- lookAhead anyTok
+        guard $ case tt of
+                  Spaces  -> T.length t > 1
+                  LineEnd -> True
+                  _       -> False
+    pMarker e d = do
+      when (d == TwoParens) $ () <$ symbol '('
+      (start, enumtype) <- case e of
+        Decimal -> pDecimal
+        LowerRoman -> pLowerRoman
+        UpperRoman -> pUpperRoman
+        LowerAlpha -> pLowerAlpha
+        UpperAlpha -> pUpperAlpha
+      delimtype <- case d of
+        TwoParens -> TwoParens <$ symbol ')'
+        OneParen  -> OneParen <$ symbol ')'
+        Period    -> Period <$ symbol '.'
+      when (delimtype == Period &&
+           (enumtype == UpperRoman || enumtype == UpperAlpha)) $ checkSpace
+      return $! OrderedList start enumtype delimtype
     pDecimal = do
       Tok WordChars _ ds <- satisfyWord (\t ->
                               T.all isDigit t && T.length t < 10)
@@ -71,6 +96,9 @@
         Nothing    -> mzero
         Just (c,_) -> return $! (1 + ord c - ord 'A', UpperAlpha)
 
+    pLowerRomanOne = (1, LowerRoman) <$ satisfyWord (== "i")
+    pUpperRomanOne = (1, UpperRoman) <$ satisfyWord (== "I")
+
     pLowerRoman = do
       Tok WordChars _ ds <- satisfyWord (\t ->
                               T.length t < 10 &&
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commonmark-extensions-0.2.3/src/Commonmark/Extensions/Math.hs 
new/commonmark-extensions-0.2.3.2/src/Commonmark/Extensions/Math.hs
--- old/commonmark-extensions-0.2.3/src/Commonmark/Extensions/Math.hs   
2022-01-12 04:38:14.000000000 +0100
+++ new/commonmark-extensions-0.2.3.2/src/Commonmark/Extensions/Math.hs 
2022-04-02 22:42:50.000000000 +0200
@@ -4,6 +4,7 @@
   ( HasMath(..)
   , mathSpec )
 where
+import Control.Monad (mzero)
 import Commonmark.Types
 import Commonmark.Tokens
 import Commonmark.Syntax
@@ -13,6 +14,7 @@
 import Commonmark.Html
 import Text.Parsec
 import Data.Text (Text)
+import qualified Data.Text as T
 
 mathSpec :: (Monad m, IsBlock il bl, IsInline il, HasMath il)
          => SyntaxSpec m il bl
@@ -35,26 +37,28 @@
   displayMath t = (displayMath t) <$ addName "displayMath"
 
 parseMath :: (Monad m, HasMath a) => InlineParser m a
-parseMath = pDisplayMath <|> pInlineMath
-
-pInlineMath :: (Monad m, HasMath a) => InlineParser m a
-pInlineMath = try $ do
-  symbol '$'
-  notFollowedBy whitespace
-  (_, toks) <- withRaw $ many1 $
-                  choice [ () <$ symbol '\\' >> anyTok
-                         , whitespace >> lookAhead (noneOfToks [Symbol '$'])
-                         , noneOfToks [Symbol '$']
-                         ]
+parseMath = try $ do
   symbol '$'
-  return $! inlineMath (untokenize toks)
-
-pDisplayMath :: (Monad m, HasMath a) => InlineParser m a
-pDisplayMath = try $ do
-  count 2 $ symbol '$'
-  (_, toks) <- withRaw $ many1 $
-                  choice [ () <$ symbol '\\' >> anyTok
-                         , noneOfToks [Symbol '$']
-                         ]
-  count 2 $ symbol '$'
-  return $! displayMath (untokenize toks)
+  display <- (True <$ symbol '$') <|> (False <$ notFollowedBy whitespace)
+  contents <- try $ untokenize <$> pDollarsMath 0
+  if display
+     then displayMath contents <$ symbol '$'
+     else if T.all (==' ') (T.takeEnd 1 contents)
+             -- don't allow math to end with SPACE + $
+             then mzero
+             else return $ inlineMath contents
+
+-- Int is number of embedded groupings
+pDollarsMath :: Monad m => Int -> InlineParser m [Tok]
+pDollarsMath n = do
+  tk@(Tok toktype _ _) <- anyTok
+  case toktype of
+       Symbol '$'
+              | n == 0 -> return []
+       Symbol '\\' -> do
+              tk' <- anyTok
+              (tk :) . (tk' :) <$> pDollarsMath n
+       Symbol '{' -> (tk :) <$> pDollarsMath (n+1)
+       Symbol '}' | n > 0 -> (tk :) <$> pDollarsMath (n-1)
+                  | otherwise -> mzero
+       _ -> (tk :) <$> pDollarsMath n
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commonmark-extensions-0.2.3/src/Commonmark/Extensions/PipeTable.hs 
new/commonmark-extensions-0.2.3.2/src/Commonmark/Extensions/PipeTable.hs
--- old/commonmark-extensions-0.2.3/src/Commonmark/Extensions/PipeTable.hs      
2022-01-12 04:38:14.000000000 +0100
+++ new/commonmark-extensions-0.2.3.2/src/Commonmark/Extensions/PipeTable.hs    
2022-02-28 06:37:07.000000000 +0100
@@ -76,6 +76,7 @@
 pCells = try $ do
   hasPipe <- option False $ True <$ symbol '|'
   pipedCells <- many (try $ pCell <* symbol '|')
+  skipMany $ satisfyTok (hasType Spaces)
   unpipedCell <- option [] $ (:[]) <$> pCell
   let cells = pipedCells ++ unpipedCell
   guard $ not (null cells)
@@ -100,6 +101,7 @@
 pDividers = try $ do
   hasPipe <- option False $ True <$ symbol '|'
   pipedAligns <- many (try $ pDivider <* symbol '|')
+  skipMany $ satisfyTok (hasType Spaces)
   unpipedAlign <- option [] $ (:[]) <$> pDivider
   let aligns = pipedAligns ++ unpipedAlign
   guard $ not (null aligns)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/commonmark-extensions-0.2.3/test/fancy_lists.md 
new/commonmark-extensions-0.2.3.2/test/fancy_lists.md
--- old/commonmark-extensions-0.2.3/test/fancy_lists.md 2020-02-10 
05:43:23.000000000 +0100
+++ new/commonmark-extensions-0.2.3.2/test/fancy_lists.md       2022-02-28 
06:37:07.000000000 +0100
@@ -157,8 +157,8 @@
 ````````````````````````````````
 
 
-Note that with decimal enumerators and Upper Alpha or Upper
-Roman style, we require at least two spaces after the list
+Note that with Upper Alpha or Upper Roman style list items
+followed by periods, we require at least two spaces after the list
 marker in order to avoid capturing initials:
 
 ```````````````````````````````` example
@@ -221,3 +221,60 @@
 </ol>
 ````````````````````````````````
 
+In cases of ambiguity (such as `'v.'`, which could be
+lowercase Roman or lowercase alphabetical, we prefer an
+interpretation that continues an existing list:
+
+```````````````````````````````` example
+u. one
+v. two
+.
+<ol start="21" type="a">
+<li>one</li>
+<li>two</li>
+</ol>
+````````````````````````````````
+
+```````````````````````````````` example
+iv. one
+v. two
+.
+<ol start="4" type="i">
+<li>one</li>
+<li>two</li>
+</ol>
+````````````````````````````````
+
+When ambiguities cannot be resolved this way,
+we prefer to interpret `i.` and `I.` as Roman numerals,
+and other single letters as alphabetical:
+
+```````````````````````````````` example
+i. one
+ii. two
+.
+<ol type="i">
+<li>one</li>
+<li>two</li>
+</ol>
+````````````````````````````````
+
+```````````````````````````````` example
+I.  one
+.
+<ol type="I">
+<li>one</li>
+</ol>
+````````````````````````````````
+
+```````````````````````````````` example
+C.  one
+CI.  one
+.
+<ol start="3" type="A">
+<li>one</li>
+</ol>
+<ol start="101" type="I">
+<li>one</li>
+</ol>
+````````````````````````````````
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/commonmark-extensions-0.2.3/test/math.md 
new/commonmark-extensions-0.2.3.2/test/math.md
--- old/commonmark-extensions-0.2.3/test/math.md        2020-02-10 
05:43:23.000000000 +0100
+++ new/commonmark-extensions-0.2.3.2/test/math.md      2022-05-15 
21:57:25.000000000 +0200
@@ -37,6 +37,27 @@
 \]</span></p>
 ````````````````````````````````
 
+Note that math can contain embedded math.  In scanning
+for a closing delimiter, we skip material in balanced
+curly braces:
+
+```````````````````````````````` example
+This is display math:
+$$
+\text{Hello $x^2$}
+$$
+And this is inline math:
+$\text{Hello $x$ there!}$
+.
+<p>This is display math:
+<span class="math display">\[
+\text{Hello $x^2$}
+\]</span>
+And this is inline math:
+<span class="math inline">\(\text{Hello $x$ there!}\)</span></p>
+````````````````````````````````
+
+
 To avoid treating currency signs as math delimiters,
 one may occasionally have to backslash-escape them:
 
@@ -46,6 +67,15 @@
 <p>The cost is between $10 and 30$.</p>
 ````````````````````````````````
 
+Dollar signs must also be backslash-escaped if they
+occur within math:
+
+```````````````````````````````` example
+$\text{\$}$
+.
+<p><span class="math inline">\(\text{\$}\)</span></p>
+````````````````````````````````
+
 Everthing inside the math construction is treated
 as math, and not given its normal commonmark meaning.
 ```````````````````````````````` example

Reply via email to