File size: 1,630 Bytes
0b7eb60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a74d632..a2e06cd 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -16,6 +16,8 @@ jobs:
 
     steps:
       - uses: actions/checkout@v3
+        with:
+          submodules: true
       - name: Set up PDM
         uses: pdm-project/setup-pdm@v3
         with:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1ea3ea5..4423f72 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
 - Fix a rendering bug when line breaks exist in a link text. [#126](https://github.com/frostming/marko/issue/126)
 - Drop support of Python 3.6.
 - Update the GFM spec to the latest master branch.
+- Fix a precedence issue of parsing strikethroughs in GFM.
 
 ## v1.2.2(2022-09-22)
 
diff --git a/marko/ext/gfm/elements.py b/marko/ext/gfm/elements.py
index f2b0886..fd1e881 100644
--- a/marko/ext/gfm/elements.py
+++ b/marko/ext/gfm/elements.py
@@ -34,9 +34,10 @@ class InlineHTML(inline.InlineHTML):
 
 class Strikethrough(inline.InlineElement):
 
-    pattern = re.compile(r"~~([^~]+)~~")
+    pattern = re.compile(r"(?<!~)(~|~~)([^~]+)\1(?!~)")
     priority = 5
     parse_children = True
+    parse_group = 2
 
 
 class _MatchObj:
diff --git a/noxfile.py b/noxfile.py
index a5047e9..83a2d3a 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -5,7 +5,7 @@ import nox
 os.environ.update(PDM_IGNORE_SAVED_PYTHON="1")
 
 
-@nox.session(python=["3.6", "3.8", "3.9", "3.10", "3.11"])
+@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11"])
 def tests(session):
     session.run("pdm", "install", "-d", external=True)
     session.run("pytest", "tests/")