Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions lib/markdown2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<strong>` as tightly around the text as possible
# eg: `***abc***` -> `*<strong>abc</strong>*` instead of `<strong>*abc*</strong>`
# Makes subsequent <em> 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
Expand Down
Loading