Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion lib/markdown2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3003,7 +3003,8 @@ def __init__(self, md, options):

def sub(self, match: re.Match) -> str:
syntax = match.group(1)
text: str = match.string[match.start(): match.end()]
# use match.regs because strong/em regex may include preceding text in the match as well
text: str = match.string[match.regs[1][0]: match.end()]
if '_' in syntax:
# if using _this_ syntax, hash it to avoid processing, but don't hash the contents incase of nested syntax
text = text.replace(syntax, _hash_text(self.name + syntax))
Expand Down
1 change: 1 addition & 0 deletions test/tm-cases/code_friendly_issue646.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>A_<strong>B</strong></p>
1 change: 1 addition & 0 deletions test/tm-cases/code_friendly_issue646.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"extras":["code-friendly"]}
1 change: 1 addition & 0 deletions test/tm-cases/code_friendly_issue646.text
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A_**B**