Skip to content

Commit

Permalink
fix: don't allow symbol to be wrapped to new line (#10)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Jonas Meinerzhagen <[email protected]>
  • Loading branch information
ivorc and timmeinerzhagen committed Feb 25, 2024
1 parent 5bc9898 commit 97c248a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mkdocs_link_marker_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def __init__(self):
def on_page_content(self, html, page, config, files):
if self.config['enable_external_link']:
p_external_link = re.compile('<a href="(http.*?)">(.*?)</a>')
html = p_external_link.sub('<a href="\\1">\\2 ' + self.config['icon_external_link'] + '</a>', html)
html = p_external_link.sub('<a href="\\1">\\2&nbsp;' + self.config['icon_external_link'] + '</a>', html)

if self.config['enable_mail']:
p_mail = re.compile('<a href="(mailto:.*?)">(.*?)</a>')
html = p_mail.sub('<a href="\\1">\\2 ' + self.config['icon_mail'] + '</a>', html)
html = p_mail.sub('<a href="\\1">\\2&nbsp;' + self.config['icon_mail'] + '</a>', html)

return html

0 comments on commit 97c248a

Please sign in to comment.