From 78b61396a1c3ae191f4fc0a409d5030c575bc323 Mon Sep 17 00:00:00 2001 From: Crozzers Date: Wed, 18 Oct 2023 18:32:07 +0100 Subject: [PATCH 1/2] Fix #493 persisting when `code-friendly` extra enabled due to regex oversight. Forgot to apply all the same changes to code friendly strong re that I did to regular strong re --- lib/markdown2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/markdown2.py b/lib/markdown2.py index 88b2bced..e7384fb1 100755 --- a/lib/markdown2.py +++ b/lib/markdown2.py @@ -2334,7 +2334,7 @@ def _do_tg_spoiler(self, text): _strong_re = re.compile(r"(\*\*|__)(?=\S)(.*\S)\1", re.S) _em_re = r"(\*|_)(?=\S)(.*?\S)\1" - _code_friendly_strong_re = re.compile(r"\*\*(?=\S)(.+?[*_]*)\*\*", re.S) + _code_friendly_strong_re = re.compile(r"\*\*(?=\S)(.*\S)\*\*", re.S) _code_friendly_em_re = r"\*(?=\S)(.+?)\*" def _do_italics_and_bold(self, text): if self.extras.get('middle-word-em', True) is False: From 085e8a2f279578d582be95304e3959562fbc54f5 Mon Sep 17 00:00:00 2001 From: Crozzers Date: Wed, 18 Oct 2023 18:36:02 +0100 Subject: [PATCH 2/2] Update changes.md --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 54dc4966..144a16e1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ - [pull #524] Fix angles being escaped in style blocks (issue #523) - [pull #527] Fix base64 images being corrupted in safe mode (issue #526) - [pull #529] Add `breaks` extra with ability to hard break on backslashes (issue #525) +- [pull #532] Fix #493 persisting when `code-friendly` extra enabled ## python-markdown2 2.4.10