Skip to content

Commit 7c595e2

Browse files
facelessuserwaylan
authored andcommitted
Revert: Use simplified regex for html placeholders
Not sure how tests didn't get run on this, but it was completely breaking all tests. This reverts the change.
1 parent c5f1395 commit 7c595e2

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

docs/change_log/release-3.2.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,4 @@ The following bug fixes are included in the 3.2 release:
9393
* HTML tag placeholders are no longer included in `.toc_tokens` (#899).
9494
* Unescape backslash-escaped characters in TOC ids (#864).
9595
* Refactor bold and italic logic in order to solve complex nesting issues (#792).
96-
* Always wrap CodeHilite code in <code> tags (#862) </code>
97-
* Regex for HTML placeholders simplified for speed improvement (#928).
96+
* Always wrap CodeHilite code in `code` tags (#862)

markdown/postprocessors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def run(self, text):
7777
replacements[self.md.htmlStash.get_placeholder(i)] = html
7878

7979
if replacements:
80-
pattern = util.HTML_PLACEHOLDER_RE
80+
pattern = re.compile("|".join(re.escape(k) for k in replacements))
8181
processed_text = pattern.sub(lambda m: replacements[m.group(0)], text)
8282
else:
8383
return text

0 commit comments

Comments
 (0)