Skip to content

Commit

Permalink
match for raw placeholders in links as well
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanParish committed Aug 26, 2024
1 parent a26c329 commit 93fd26d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions notifications_utils/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,8 +748,8 @@ def strip_placeholder_parens_from_links_in_preview(value: str) -> str:
# find all markdown links with placeholders in them and replace the parentheses and html tags with !! and ##
for item in re.finditer(markdown_link_pattern, value):
link = item.group(0)
modified_link = re.sub(r'(<span class=[\'\"]placeholder[\'\"]><mark>\(\()', '!!', link)
modified_link = re.sub(r'(\)\)<\/mark><\/span>)', '##', modified_link)
modified_link = re.sub(r'((<span class=[\'\"]placeholder[\'\"]><mark>)?\(\()', '!!', link)
modified_link = re.sub(r'(\)\)(<\/mark><\/span>)?)', '##', modified_link)

value = value.replace(link, modified_link)

Expand Down

0 comments on commit 93fd26d

Please sign in to comment.