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 2023-11-08 22:17:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-commonmark-extensions (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-commonmark-extensions.new.17445 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-commonmark-extensions"

Wed Nov  8 22:17:41 2023 rev:13 rq:1124058 version:0.2.4

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/ghc-commonmark-extensions/ghc-commonmark-extensions.changes
      2023-09-21 22:23:40.310222817 +0200
+++ 
/work/SRC/openSUSE:Factory/.ghc-commonmark-extensions.new.17445/ghc-commonmark-extensions.changes
   2023-11-08 22:17:58.627722523 +0100
@@ -1,0 +2,15 @@
+Fri Oct 27 17:34:06 UTC 2023 - Peter Simons <psim...@suse.com>
+
+- Update commonmark-extensions to version 0.2.4.
+  ## 0.2.4
+
+    * Make `pipe_tables` extension treat backslash escapes like GH does (#112,
+      Michael Howell). This change essentially changes the way the text
+      `\\|` gets parsed inside a table. In the old version, the first backslash
+      escapes the second backslash, and then the pipe is treated as a cell
+      separator. In the new version, the pipe is still preceded by a backslash,
+      so it is still literal text. The escaping rule is documented in detail
+      in the spec for this extension. This change also aligns our escaping
+      of pipes with GitHub's.
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ ghc-commonmark-extensions.spec ++++++
--- /var/tmp/diff_new_pack.UxYeh6/_old  2023-11-08 22:17:59.439752354 +0100
+++ /var/tmp/diff_new_pack.UxYeh6/_new  2023-11-08 22:17:59.439752354 +0100
@@ -20,7 +20,7 @@
 %global pkgver %{pkg_name}-%{version}
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        0.2.3.6
+Version:        0.2.4
 Release:        0
 Summary:        Pure Haskell commonmark parser
 License:        BSD-3-Clause

++++++ commonmark-extensions-0.2.3.6.tar.gz -> 
commonmark-extensions-0.2.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/commonmark-extensions-0.2.3.6/changelog.md 
new/commonmark-extensions-0.2.4/changelog.md
--- old/commonmark-extensions-0.2.3.6/changelog.md      2001-09-09 
03:46:40.000000000 +0200
+++ new/commonmark-extensions-0.2.4/changelog.md        2001-09-09 
03:46:40.000000000 +0200
@@ -1,5 +1,16 @@
 # Changelog for commonmark-extensions
 
+## 0.2.4
+
+  * Make `pipe_tables` extension treat backslash escapes like GH does (#112,
+    Michael Howell). This change essentially changes the way the text
+    `\\|` gets parsed inside a table. In the old version, the first backslash
+    escapes the second backslash, and then the pipe is treated as a cell
+    separator. In the new version, the pipe is still preceded by a backslash,
+    so it is still literal text. The escaping rule is documented in detail
+    in the spec for this extension. This change also aligns our escaping
+    of pipes with GitHub's.
+
 ## 0.2.3.6
 
   * Fix pipe table parser so that `|`s don't interfere with
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commonmark-extensions-0.2.3.6/commonmark-extensions.cabal 
new/commonmark-extensions-0.2.4/commonmark-extensions.cabal
--- old/commonmark-extensions-0.2.3.6/commonmark-extensions.cabal       
2001-09-09 03:46:40.000000000 +0200
+++ new/commonmark-extensions-0.2.4/commonmark-extensions.cabal 2001-09-09 
03:46:40.000000000 +0200
@@ -1,5 +1,5 @@
 name:           commonmark-extensions
-version:        0.2.3.6
+version:        0.2.4
 synopsis:       Pure Haskell commonmark parser.
 description:
    This library provides some useful extensions to core commonmark
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commonmark-extensions-0.2.3.6/src/Commonmark/Extensions/PipeTable.hs 
new/commonmark-extensions-0.2.4/src/Commonmark/Extensions/PipeTable.hs
--- old/commonmark-extensions-0.2.3.6/src/Commonmark/Extensions/PipeTable.hs    
2001-09-09 03:46:40.000000000 +0200
+++ new/commonmark-extensions-0.2.4/src/Commonmark/Extensions/PipeTable.hs      
2001-09-09 03:46:40.000000000 +0200
@@ -88,11 +88,9 @@
 pCell :: Monad m => ParsecT [Tok] s m [Tok]
 pCell = mconcat <$> many1
   ( try
-      (do tok' <- symbol '\\'
-          tok@(Tok (Symbol c) _ _) <- anySymbol
-          if c == '|'
-             then return $! [tok]
-             else return $! [tok',tok])
+      (do symbol '\\'
+          tok <- symbol '|'
+          return $! [tok])
   <|> (do tok <- (satisfyTok $ \t -> not (hasType (Symbol '|') t ||
                                        hasType LineEnd t))
           return $! [tok])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/commonmark-extensions-0.2.3.6/test/pipe_tables.md 
new/commonmark-extensions-0.2.4/test/pipe_tables.md
--- old/commonmark-extensions-0.2.3.6/test/pipe_tables.md       2001-09-09 
03:46:40.000000000 +0200
+++ new/commonmark-extensions-0.2.4/test/pipe_tables.md 2001-09-09 
03:46:40.000000000 +0200
@@ -312,3 +312,157 @@
 ----|-----</p>
 </blockquote>
 ````````````````````````````````
+
+
+As a special case, pipes in inline code in tables are escaped
+with backslashes.
+
+The parsing rule for CommonMark is that block structures are parsed before
+inline structures are. Normally, this means backslashes aren't allowed to have
+any effect on block structures at all. Tables do consider backslashes, but
+not the same way inline syntax does.
+
+The table parser, which runs as part of the block structure parsing stage, 
splits rows into cells on unescaped `|` symbols, and it replaces `\|` with a 
literal `|`. Then it passes the contents of each cell separately to the inline 
parser. This means backslash escaping pipes works even in code spans (where 
backslashes are usually treated as literal text), but it can also result in 
some counterintuitive results.
+
+For example, consider these two rows, excerpted from the below test case:
+
+    | Wait, what? |          \|
+    | Wait, what? |         \\|
+
+The table parser only pays attention to the backslash that is immediately 
followed by a pipe. This means it sees the second row as this:
+
+    | Wait, what? |         \\|
+                            -^^ escaped pipe found here
+                            |
+                            literal backslash with no special block-level 
semantics
+
+And the inline parser is given the first backslash, followed by the pipe:
+
+    \|
+
+The inline parser then sees it as an backslash-escaped pipe, and writes the 
`|` on its own. Both rows result in exactly the same HTML.
+
+
+    <tr>
+    <td>Wait, what?</td>
+    <td>|</td>
+    </tr>
+    <tr>
+    <td>Wait, what?</td>
+    <td>|</td>
+    </tr>
+
+You need to write `\\\|` to actually get `\|` to show up in the output.
+
+This rule should be identical to GitHub's. See
+<https://gist.github.com/notriddle/c027512ee849f12098fec3a3256c89d3>
+for what they do.
+
+This changes the behavior from what older versions of commonmark-extensions do,
+but it fixes some expressiveness holes that hit older versions.
+
+```````````````````````````````` example
+| Description | Test case |
+|-------------|-----------|
+| Single      | `\`       |
+| Double      | `\\`      |
+| Basic test  | `\|`      |
+| Basic test 2| `\|\|\`   |
+| Basic test 3| `x\|y\|z\`|
+| Not pipe    | `\.`      |
+| Combo       | `\.\|\`   |
+| Extra       | `\\\.`    |
+| Wait, what? | `\\|`     |
+| Wait, what? | `\\\|`    |
+| Wait, what? | `\\\\|`   |
+| Wait, what? | `\\\\\|`  |
+| Wait, what? |          \|
+| Wait, what? |         \\|
+| Wait, what? |        \\\|
+| Wait, what?x|          \|x
+| Wait, what?x|         \\|x
+| Wait, what?x|        \\\|x
+.
+<table>
+<thead>
+<tr>
+<th>Description</th>
+<th>Test case</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Single</td>
+<td><code>\</code></td>
+</tr>
+<tr>
+<td>Double</td>
+<td><code>\\</code></td>
+</tr>
+<tr>
+<td>Basic test</td>
+<td><code>|</code></td>
+</tr>
+<tr>
+<td>Basic test 2</td>
+<td><code>||\</code></td>
+</tr>
+<tr>
+<td>Basic test 3</td>
+<td><code>x|y|z\</code></td>
+</tr>
+<tr>
+<td>Not pipe</td>
+<td><code>\.</code></td>
+</tr>
+<tr>
+<td>Combo</td>
+<td><code>\.|\</code></td>
+</tr>
+<tr>
+<td>Extra</td>
+<td><code>\\\.</code></td>
+</tr>
+<tr>
+<td>Wait, what?</td>
+<td><code>\|</code></td>
+</tr>
+<tr>
+<td>Wait, what?</td>
+<td><code>\\|</code></td>
+</tr>
+<tr>
+<td>Wait, what?</td>
+<td><code>\\\|</code></td>
+</tr>
+<tr>
+<td>Wait, what?</td>
+<td><code>\\\\|</code></td>
+</tr>
+<tr>
+<td>Wait, what?</td>
+<td>|</td>
+</tr>
+<tr>
+<td>Wait, what?</td>
+<td>|</td>
+</tr>
+<tr>
+<td>Wait, what?</td>
+<td>\|</td>
+</tr>
+<tr>
+<td>Wait, what?x</td>
+<td>|x</td>
+</tr>
+<tr>
+<td>Wait, what?x</td>
+<td>|x</td>
+</tr>
+<tr>
+<td>Wait, what?x</td>
+<td>\|x</td>
+</tr>
+</tbody>
+</table>
+````````````````````````````````

Reply via email to