Skip to content

Commit

Permalink
Tiny regex change
Browse files Browse the repository at this point in the history
Require at least one char in the tag to match and replace the group, added lazy modifier
  • Loading branch information
LunarWatcher committed May 18, 2018
1 parent 77def3b commit 54e8e89
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions helpers.py
Expand Up @@ -107,9 +107,9 @@ def clean_html(raw_message):
"""
Removes some HTML tags from input and replaces it with markdown
"""
raw_message = regex.subf("<i>(.*)</i>", "*{1}*", raw_message)
raw_message = regex.subf("<b>(.*)</b>", "**{1}**", raw_message)
return regex.subf("<code>(.*)</code>", "`{1}`", raw_message)
raw_message = regex.subf("<i>(.+?)</i>", "*{1}*", raw_message)
raw_message = regex.subf("<b>(.+?)</b>", "**{1}**", raw_message)
return regex.subf("<code>(.+?)</code>", "`{1}`", raw_message)


class SecurityError(Exception):
Expand Down

0 comments on commit 54e8e89

Please sign in to comment.