Skip to content

Commit 49c27bb

Browse files
committed
Add back stripEscape used by plugins
1 parent 5a2e003 commit 49c27bb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

markdown_it/common/utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ def replacer_func(match):
156156
return UNESCAPE_ALL_RE.sub(replacer_func, string)
157157

158158

159+
ESCAPABLE = r"""\\!"#$%&'()*+,./:;<=>?@\[\]^`{}|_~-"""
160+
ESCAPE_CHAR = re.compile(r"\\([" + ESCAPABLE + r"])")
161+
162+
163+
def stripEscape(string: str) -> str:
164+
"""Strip escape \\ characters"""
165+
return ESCAPE_CHAR.sub(r"\1", string)
166+
167+
159168
# //////////////////////////////////////////////////////////////////////////////
160169

161170
# TODO This section changed quite a lot, should re-check

0 commit comments

Comments
 (0)