diff --git a/lib/markdown2.py b/lib/markdown2.py index 14ae415c..8fb79878 100755 --- a/lib/markdown2.py +++ b/lib/markdown2.py @@ -2036,16 +2036,7 @@ def _encode_code(self, text: str) -> str: self._code_table[text] = hashed return hashed - _strong_re = re.compile(r''' - (?:_{1,}|\*{1,})? # ignore any leading em chars because we want to wrap `` as tightly around the text as possible - # eg: `***abc***` -> `*abc*` instead of `*abc*` - # Makes subsequent processing easier - (\*\*|__)(?=\S) # strong syntax - must be followed by a non whitespace char - (.+?) # the strong text itself - (?<=\S)\1 # closing syntax - must be preceeded by non whitespace char - ''', - re.S | re.X - ) + _strong_re = _strong_re = re.compile(r"(\*\*|__)(?=\S)(.+?[*_]?)(?<=\S)\1", re.S) _em_re = re.compile(r"(\*|_)(?=\S)(.*?\S)\1", re.S) _iab_processor = None