Skip to content

Commit

Permalink
squash 169
Browse files Browse the repository at this point in the history
  • Loading branch information
kalbfled committed Dec 6, 2024
1 parent 2718324 commit 0ca3da4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions notifications_utils/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,7 @@ def hrule(md):
class NotifyHTMLRenderer(HTMLRenderer):
def link(self, text, url, title=None):
value = super().link(text, url, title)
# print('LINK', text, url, title, value) # TODO
return value[:3] + f'style="{LINK_STYLE}"' + value[2:]
return value[:2] + f' style="{LINK_STYLE}"' + value[2:]

def paragraph(self, text):
value = super().paragraph(text)
Expand All @@ -437,7 +436,7 @@ class NotifyMarkdownRenderer(MarkdownRenderer):


notify_html_markdown = mistune.create_markdown(
renderer=NotifyHTMLRenderer(),
renderer=NotifyHTMLRenderer(escape=False),
plugins=['url'],
)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_handles_placeholders_in_urls():
'http://example.com/?token='
'</a>'
'<span class=\'placeholder\'>((token))</span>&amp;key=1'
'</p>'
'</p>\n'
)


Expand Down

0 comments on commit 0ca3da4

Please sign in to comment.