Skip to content

Commit 8c0b3bc

Browse files
committed
Only escape # and @ when they could be part of an issue number/handle
1 parent b645616 commit 8c0b3bc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llvm/utils/git/github-automation.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ def _get_curent_team(team_name, teams) -> Optional[github.Team.Team]:
5050
def escape_description(str):
5151
# https://github.com/github/markup/issues/1168#issuecomment-494946168
5252
str = html.escape(str, False)
53-
return str.replace("@", "@<!-- -->").replace("#", "#<!-- -->")
53+
# '@' followed by alphanum is a user name
54+
str = re.sub("@(?=\w+)","@<!-- -->", str)
55+
# '#' followed by digits is considered an issue number
56+
str = re.sub("#(?=\d+\s)", "#<!-- -->", str)
57+
return str
5458

5559

5660
class IssueSubscriber:

0 commit comments

Comments
 (0)