We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Import wildcard mentions from Slack into zulip
When a user does a wildcard mention (i.e. `@channel`, `@here`, etc.), we should translate those to a zulip wildcard mention.  I'd probably map them all to `@all` for now, but we should write the code in a way where changing the mapping is easy
Import wildcard mentions from Slack into zulip
When a user does a wildcard mention (i.e. `@channel`, `@here`, etc.), we should translate those to a zulip wildcard mention.  I'd probably map them all to `@all` for now, but we should write the code in a way where changing the mapping is easy

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `zerver/lib/slack_message_conversion.py`
Content:
```
1 import re
2 from typing import Any, Dict, Tuple, List
3 
4 # stubs
5 ZerverFieldsT = Dict[str, Any]
6 AddedUsersT = Dict[str, int]
7 
8 # Slack link can be in the format <http://www.foo.com|www.foo.com> and <http://foo.com/>
9 LINK_REGEX = r"""
10               (<)                                                              # match '>'
11               (http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/|ftp:\/\/)?  # protocol and www
12                   ([a-z0-9]+([\-\.]{1}[a-z0-9]+)*)(\.)                         # domain name
13                       ([a-z]{2,63}(:[0-9]{1,5})?)                              # domain
14                   (\/[^>]*)?                                                   # path
15               (\|)?(?:\|([^>]+))?                                # char after pipe (for slack links)
16               (>)
17               """
18 
19 SLACK_MAILTO_REGEX = r"""
20                       <((mailto:)?                     # match  `<mailto:`
21                       ([\w\.-]+@[\w\.-]+(\.[\w]+)+))   # match email
22                           (\|)?                        # match pipe
23                       ([\w\.-]+@[\w\.-]+(\.[\w]+)+)?>  # match email
24                       """
25 
26 SLACK_USERMENTION_REGEX = r"""
27                            (<@)                  # Start with '<@'
28                                ([a-zA-Z0-9]+)    # Here we have the Slack id
29                            (\|)?                 # We not always have a Vertical line in mention
30                                ([a-zA-Z0-9]+)?   # If Vertical line is present, this is short name
31                            (>)                   # ends with '>'
32                            """
33 # Slack doesn't have mid-word message-formatting like Zulip.
34 # Hence, ~stri~ke doesn't format the word in slack, but ~~stri~~ke
35 # formats the word in Zulip
36 SLACK_STRIKETHROUGH_REGEX = r"""
37                              (^|[ -(]|[+-/]|\*|\_|[:-?]|\{|\[|\||\^)     # Start after specified characters
38                              (\~)                                  # followed by an asterisk
39                                  ([ -)+-}—]*)([ -}]+)              # any character except asterisk
40                              (\~)                                  # followed by an asterisk
41                              ($|[ -']|[+-/]|[:-?]|\*|\_|\}|\)|\]|\||\^)  # ends with specified characters
42                              """
43 SLACK_ITALIC_REGEX = r"""
44                       (^|[ -(]|[+-/]|[:-?]|\{|\[|\||\^|~)
45                       (\_)
46                           ([ -^`~—]*)([ -^`-~]+)                  # any character
47                       (\_)
48                       ($|[ -']|[+-/]|[:-?]|\}|\)|\]|\||\^|~)
49                       """
50 SLACK_BOLD_REGEX = r"""
51                     (^|[ -(]|[+-/]|[:-?]|\{|\[|\||\^|~)
52                     (\*)
53                         ([ -)+-~—]*)([ -)+-~]+)                   # any character
54                     (\*)
55                     ($|[ -']|[+-/]|[:-?]|\}|\)|\]|\||\^|~)
56                     """
57 
58 def get_user_full_name(user: ZerverFieldsT) -> str:
59     if user['deleted'] is False:
60         if user['real_name'] == '':
61             return user['name']
62         else:
63             return user['real_name']
64     else:
65         return user['name']
66 
67 # Markdown mapping
68 def convert_to_zulip_markdown(text: str, users: List[ZerverFieldsT],
69                               added_users: AddedUsersT) -> Tuple[str, List[int], bool]:
70     mentioned_users_id = []
71     text = convert_markdown_syntax(text, SLACK_BOLD_REGEX, "**")
72     text = convert_markdown_syntax(text, SLACK_STRIKETHROUGH_REGEX, "~~")
73     text = convert_markdown_syntax(text, SLACK_ITALIC_REGEX, "*")
74 
75     # Map Slack's mention all: '<!everyone>' to '@**all** '
76     # No regex for this as it can be present anywhere in the sentence
77     text = text.replace('<!everyone>', '@**all**')
78 
79     tokens = text.split(' ')
80     for iterator in range(len(tokens)):
81 
82         # Check user mentions and change mention format from
83         # '<@slack_id|short_name>' to '@**full_name**'
84         if (re.findall(SLACK_USERMENTION_REGEX, tokens[iterator], re.VERBOSE)):
85             tokens[iterator], user_id = get_user_mentions(tokens[iterator],
86                                                           users, added_users)
87             if user_id is not None:
88                 mentioned_users_id.append(user_id)
89 
90     text = ' '.join(tokens)
91 
92     # Check and convert link format
93     text, has_link = convert_link_format(text)
94     # convert `<mailto:foo@foo.com>` to `mailto:foo@foo.com`
95     text, has_mailto_link = convert_mailto_format(text)
96 
97     if has_link is True or has_mailto_link is True:
98         message_has_link = True
99     else:
100         message_has_link = False
101 
102     return text, mentioned_users_id, message_has_link
103 
104 def get_user_mentions(token: str, users: List[ZerverFieldsT],
105                       added_users: AddedUsersT) -> Tuple[str, int]:
106     slack_usermention_match = re.search(SLACK_USERMENTION_REGEX, token, re.VERBOSE)
107     short_name = slack_usermention_match.group(4)
108     slack_id = slack_usermention_match.group(2)
109     for user in users:
110         if (user['id'] == slack_id and user['name'] == short_name and short_name) or \
111            (user['id'] == slack_id and short_name is None):
112                 full_name = get_user_full_name(user)
113                 user_id = added_users[slack_id]
114                 mention = "@**" + full_name + "**"
115                 token = re.sub(SLACK_USERMENTION_REGEX, mention, token, flags=re.VERBOSE)
116                 return token, user_id
117     return token, None
118 
119 # Map italic, bold and strikethrough markdown
120 def convert_markdown_syntax(text: str, regex: str, zulip_keyword: str) -> str:
121     """
122     Returns:
123     1. For strikethrough formatting: This maps Slack's '~strike~' to Zulip's '~~strike~~'
124     2. For bold formatting: This maps Slack's '*bold*' to Zulip's '**bold**'
125     3. For italic formatting: This maps Slack's '_italic_' to Zulip's '*italic*'
126     """
127     for match in re.finditer(regex, text, re.VERBOSE):
128         converted_token = (match.group(1) + zulip_keyword + match.group(3)
129                            + match.group(4) + zulip_keyword + match.group(6))
130         text = text.replace(match.group(0), converted_token)
131     return text
132 
133 def convert_link_format(text: str) -> Tuple[str, bool]:
134     """
135     1. Converts '<https://foo.com>' to 'https://foo.com'
136     2. Converts '<https://foo.com|foo>' to 'https://foo.com|foo'
137     """
138     has_link = False
139     for match in re.finditer(LINK_REGEX, text, re.VERBOSE):
140         converted_text = match.group(0).replace('>', '').replace('<', '')
141         has_link = True
142         text = text.replace(match.group(0), converted_text)
143     return text, has_link
144 
145 def convert_mailto_format(text: str) -> Tuple[str, bool]:
146     """
147     1. Converts '<mailto:foo@foo.com>' to 'mailto:foo@foo.com'
148     2. Converts '<mailto:foo@foo.com|foo@foo.com>' to 'mailto:foo@foo.com'
149     """
150     has_link = False
151     for match in re.finditer(SLACK_MAILTO_REGEX, text, re.VERBOSE):
152         has_link = True
153         text = text.replace(match.group(0), match.group(1))
154     return text, has_link
155
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/zerver/lib/slack_message_conversion.py b/zerver/lib/slack_message_conversion.py
--- a/zerver/lib/slack_message_conversion.py
+++ b/zerver/lib/slack_message_conversion.py
@@ -73,8 +73,12 @@
     text = convert_markdown_syntax(text, SLACK_ITALIC_REGEX, "*")
 
     # Map Slack's mention all: '<!everyone>' to '@**all** '
+    # Map Slack's mention all: '<!channel>' to '@**all** '
+    # Map Slack's mention all: '<!here>' to '@**all** '
     # No regex for this as it can be present anywhere in the sentence
     text = text.replace('<!everyone>', '@**all**')
+    text = text.replace('<!channel>', '@**all**')
+    text = text.replace('<!here>', '@**all**')
 
     tokens = text.split(' ')
     for iterator in range(len(tokens)):

{"golden_diff": "diff --git a/zerver/lib/slack_message_conversion.py b/zerver/lib/slack_message_conversion.py\n--- a/zerver/lib/slack_message_conversion.py\n+++ b/zerver/lib/slack_message_conversion.py\n@@ -73,8 +73,12 @@\n     text = convert_markdown_syntax(text, SLACK_ITALIC_REGEX, \"*\")\n \n     # Map Slack's mention all: '<!everyone>' to '@**all** '\n+    # Map Slack's mention all: '<!channel>' to '@**all** '\n+    # Map Slack's mention all: '<!here>' to '@**all** '\n     # No regex for this as it can be present anywhere in the sentence\n     text = text.replace('<!everyone>', '@**all**')\n+    text = text.replace('<!channel>', '@**all**')\n+    text = text.replace('<!here>', '@**all**')\n \n     tokens = text.split(' ')\n     for iterator in range(len(tokens)):\n", "issue": "Import wildcard mentions from Slack into zulip\nWhen a user does a wildcard mention (i.e. `@channel`, `@here`, etc.), we should translate those to a zulip wildcard mention.  I'd probably map them all to `@all` for now, but we should write the code in a way where changing the mapping is easy\nImport wildcard mentions from Slack into zulip\nWhen a user does a wildcard mention (i.e. `@channel`, `@here`, etc.), we should translate those to a zulip wildcard mention.  I'd probably map them all to `@all` for now, but we should write the code in a way where changing the mapping is easy\n", "before_files": [{"content": "import re\nfrom typing import Any, Dict, Tuple, List\n\n# stubs\nZerverFieldsT = Dict[str, Any]\nAddedUsersT = Dict[str, int]\n\n# Slack link can be in the format <http://www.foo.com|www.foo.com> and <http://foo.com/>\nLINK_REGEX = r\"\"\"\n              (<)                                                              # match '>'\n              (http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/|ftp:\\/\\/)?  # protocol and www\n                  ([a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*)(\\.)                         # domain name\n                      ([a-z]{2,63}(:[0-9]{1,5})?)                              # domain\n                  (\\/[^>]*)?                                                   # path\n              (\\|)?(?:\\|([^>]+))?                                # char after pipe (for slack links)\n              (>)\n              \"\"\"\n\nSLACK_MAILTO_REGEX = r\"\"\"\n                      <((mailto:)?                     # match  `<mailto:`\n                      ([\\w\\.-]+@[\\w\\.-]+(\\.[\\w]+)+))   # match email\n                          (\\|)?                        # match pipe\n                      ([\\w\\.-]+@[\\w\\.-]+(\\.[\\w]+)+)?>  # match email\n                      \"\"\"\n\nSLACK_USERMENTION_REGEX = r\"\"\"\n                           (<@)                  # Start with '<@'\n                               ([a-zA-Z0-9]+)    # Here we have the Slack id\n                           (\\|)?                 # We not always have a Vertical line in mention\n                               ([a-zA-Z0-9]+)?   # If Vertical line is present, this is short name\n                           (>)                   # ends with '>'\n                           \"\"\"\n# Slack doesn't have mid-word message-formatting like Zulip.\n# Hence, ~stri~ke doesn't format the word in slack, but ~~stri~~ke\n# formats the word in Zulip\nSLACK_STRIKETHROUGH_REGEX = r\"\"\"\n                             (^|[ -(]|[+-/]|\\*|\\_|[:-?]|\\{|\\[|\\||\\^)     # Start after specified characters\n                             (\\~)                                  # followed by an asterisk\n                                 ([ -)+-}\u2014]*)([ -}]+)              # any character except asterisk\n                             (\\~)                                  # followed by an asterisk\n                             ($|[ -']|[+-/]|[:-?]|\\*|\\_|\\}|\\)|\\]|\\||\\^)  # ends with specified characters\n                             \"\"\"\nSLACK_ITALIC_REGEX = r\"\"\"\n                      (^|[ -(]|[+-/]|[:-?]|\\{|\\[|\\||\\^|~)\n                      (\\_)\n                          ([ -^`~\u2014]*)([ -^`-~]+)                  # any character\n                      (\\_)\n                      ($|[ -']|[+-/]|[:-?]|\\}|\\)|\\]|\\||\\^|~)\n                      \"\"\"\nSLACK_BOLD_REGEX = r\"\"\"\n                    (^|[ -(]|[+-/]|[:-?]|\\{|\\[|\\||\\^|~)\n                    (\\*)\n                        ([ -)+-~\u2014]*)([ -)+-~]+)                   # any character\n                    (\\*)\n                    ($|[ -']|[+-/]|[:-?]|\\}|\\)|\\]|\\||\\^|~)\n                    \"\"\"\n\ndef get_user_full_name(user: ZerverFieldsT) -> str:\n    if user['deleted'] is False:\n        if user['real_name'] == '':\n            return user['name']\n        else:\n            return user['real_name']\n    else:\n        return user['name']\n\n# Markdown mapping\ndef convert_to_zulip_markdown(text: str, users: List[ZerverFieldsT],\n                              added_users: AddedUsersT) -> Tuple[str, List[int], bool]:\n    mentioned_users_id = []\n    text = convert_markdown_syntax(text, SLACK_BOLD_REGEX, \"**\")\n    text = convert_markdown_syntax(text, SLACK_STRIKETHROUGH_REGEX, \"~~\")\n    text = convert_markdown_syntax(text, SLACK_ITALIC_REGEX, \"*\")\n\n    # Map Slack's mention all: '<!everyone>' to '@**all** '\n    # No regex for this as it can be present anywhere in the sentence\n    text = text.replace('<!everyone>', '@**all**')\n\n    tokens = text.split(' ')\n    for iterator in range(len(tokens)):\n\n        # Check user mentions and change mention format from\n        # '<@slack_id|short_name>' to '@**full_name**'\n        if (re.findall(SLACK_USERMENTION_REGEX, tokens[iterator], re.VERBOSE)):\n            tokens[iterator], user_id = get_user_mentions(tokens[iterator],\n                                                          users, added_users)\n            if user_id is not None:\n                mentioned_users_id.append(user_id)\n\n    text = ' '.join(tokens)\n\n    # Check and convert link format\n    text, has_link = convert_link_format(text)\n    # convert `<mailto:foo@foo.com>` to `mailto:foo@foo.com`\n    text, has_mailto_link = convert_mailto_format(text)\n\n    if has_link is True or has_mailto_link is True:\n        message_has_link = True\n    else:\n        message_has_link = False\n\n    return text, mentioned_users_id, message_has_link\n\ndef get_user_mentions(token: str, users: List[ZerverFieldsT],\n                      added_users: AddedUsersT) -> Tuple[str, int]:\n    slack_usermention_match = re.search(SLACK_USERMENTION_REGEX, token, re.VERBOSE)\n    short_name = slack_usermention_match.group(4)\n    slack_id = slack_usermention_match.group(2)\n    for user in users:\n        if (user['id'] == slack_id and user['name'] == short_name and short_name) or \\\n           (user['id'] == slack_id and short_name is None):\n                full_name = get_user_full_name(user)\n                user_id = added_users[slack_id]\n                mention = \"@**\" + full_name + \"**\"\n                token = re.sub(SLACK_USERMENTION_REGEX, mention, token, flags=re.VERBOSE)\n                return token, user_id\n    return token, None\n\n# Map italic, bold and strikethrough markdown\ndef convert_markdown_syntax(text: str, regex: str, zulip_keyword: str) -> str:\n    \"\"\"\n    Returns:\n    1. For strikethrough formatting: This maps Slack's '~strike~' to Zulip's '~~strike~~'\n    2. For bold formatting: This maps Slack's '*bold*' to Zulip's '**bold**'\n    3. For italic formatting: This maps Slack's '_italic_' to Zulip's '*italic*'\n    \"\"\"\n    for match in re.finditer(regex, text, re.VERBOSE):\n        converted_token = (match.group(1) + zulip_keyword + match.group(3)\n                           + match.group(4) + zulip_keyword + match.group(6))\n        text = text.replace(match.group(0), converted_token)\n    return text\n\ndef convert_link_format(text: str) -> Tuple[str, bool]:\n    \"\"\"\n    1. Converts '<https://foo.com>' to 'https://foo.com'\n    2. Converts '<https://foo.com|foo>' to 'https://foo.com|foo'\n    \"\"\"\n    has_link = False\n    for match in re.finditer(LINK_REGEX, text, re.VERBOSE):\n        converted_text = match.group(0).replace('>', '').replace('<', '')\n        has_link = True\n        text = text.replace(match.group(0), converted_text)\n    return text, has_link\n\ndef convert_mailto_format(text: str) -> Tuple[str, bool]:\n    \"\"\"\n    1. Converts '<mailto:foo@foo.com>' to 'mailto:foo@foo.com'\n    2. Converts '<mailto:foo@foo.com|foo@foo.com>' to 'mailto:foo@foo.com'\n    \"\"\"\n    has_link = False\n    for match in re.finditer(SLACK_MAILTO_REGEX, text, re.VERBOSE):\n        has_link = True\n        text = text.replace(match.group(0), match.group(1))\n    return text, has_link\n", "path": "zerver/lib/slack_message_conversion.py"}], "after_files": [{"content": "import re\nfrom typing import Any, Dict, Tuple, List\n\n# stubs\nZerverFieldsT = Dict[str, Any]\nAddedUsersT = Dict[str, int]\n\n# Slack link can be in the format <http://www.foo.com|www.foo.com> and <http://foo.com/>\nLINK_REGEX = r\"\"\"\n              (<)                                                              # match '>'\n              (http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/|ftp:\\/\\/)?  # protocol and www\n                  ([a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*)(\\.)                         # domain name\n                      ([a-z]{2,63}(:[0-9]{1,5})?)                              # domain\n                  (\\/[^>]*)?                                                   # path\n              (\\|)?(?:\\|([^>]+))?                                # char after pipe (for slack links)\n              (>)\n              \"\"\"\n\nSLACK_MAILTO_REGEX = r\"\"\"\n                      <((mailto:)?                     # match  `<mailto:`\n                      ([\\w\\.-]+@[\\w\\.-]+(\\.[\\w]+)+))   # match email\n                          (\\|)?                        # match pipe\n                      ([\\w\\.-]+@[\\w\\.-]+(\\.[\\w]+)+)?>  # match email\n                      \"\"\"\n\nSLACK_USERMENTION_REGEX = r\"\"\"\n                           (<@)                  # Start with '<@'\n                               ([a-zA-Z0-9]+)    # Here we have the Slack id\n                           (\\|)?                 # We not always have a Vertical line in mention\n                               ([a-zA-Z0-9]+)?   # If Vertical line is present, this is short name\n                           (>)                   # ends with '>'\n                           \"\"\"\n# Slack doesn't have mid-word message-formatting like Zulip.\n# Hence, ~stri~ke doesn't format the word in slack, but ~~stri~~ke\n# formats the word in Zulip\nSLACK_STRIKETHROUGH_REGEX = r\"\"\"\n                             (^|[ -(]|[+-/]|\\*|\\_|[:-?]|\\{|\\[|\\||\\^)     # Start after specified characters\n                             (\\~)                                  # followed by an asterisk\n                                 ([ -)+-}\u2014]*)([ -}]+)              # any character except asterisk\n                             (\\~)                                  # followed by an asterisk\n                             ($|[ -']|[+-/]|[:-?]|\\*|\\_|\\}|\\)|\\]|\\||\\^)  # ends with specified characters\n                             \"\"\"\nSLACK_ITALIC_REGEX = r\"\"\"\n                      (^|[ -(]|[+-/]|[:-?]|\\{|\\[|\\||\\^|~)\n                      (\\_)\n                          ([ -^`~\u2014]*)([ -^`-~]+)                  # any character\n                      (\\_)\n                      ($|[ -']|[+-/]|[:-?]|\\}|\\)|\\]|\\||\\^|~)\n                      \"\"\"\nSLACK_BOLD_REGEX = r\"\"\"\n                    (^|[ -(]|[+-/]|[:-?]|\\{|\\[|\\||\\^|~)\n                    (\\*)\n                        ([ -)+-~\u2014]*)([ -)+-~]+)                   # any character\n                    (\\*)\n                    ($|[ -']|[+-/]|[:-?]|\\}|\\)|\\]|\\||\\^|~)\n                    \"\"\"\n\ndef get_user_full_name(user: ZerverFieldsT) -> str:\n    if user['deleted'] is False:\n        if user['real_name'] == '':\n            return user['name']\n        else:\n            return user['real_name']\n    else:\n        return user['name']\n\n# Markdown mapping\ndef convert_to_zulip_markdown(text: str, users: List[ZerverFieldsT],\n                              added_users: AddedUsersT) -> Tuple[str, List[int], bool]:\n    mentioned_users_id = []\n    text = convert_markdown_syntax(text, SLACK_BOLD_REGEX, \"**\")\n    text = convert_markdown_syntax(text, SLACK_STRIKETHROUGH_REGEX, \"~~\")\n    text = convert_markdown_syntax(text, SLACK_ITALIC_REGEX, \"*\")\n\n    # Map Slack's mention all: '<!everyone>' to '@**all** '\n    # Map Slack's mention all: '<!channel>' to '@**all** '\n    # Map Slack's mention all: '<!here>' to '@**all** '\n    # No regex for this as it can be present anywhere in the sentence\n    text = text.replace('<!everyone>', '@**all**')\n    text = text.replace('<!channel>', '@**all**')\n    text = text.replace('<!here>', '@**all**')\n\n    tokens = text.split(' ')\n    for iterator in range(len(tokens)):\n\n        # Check user mentions and change mention format from\n        # '<@slack_id|short_name>' to '@**full_name**'\n        if (re.findall(SLACK_USERMENTION_REGEX, tokens[iterator], re.VERBOSE)):\n            tokens[iterator], user_id = get_user_mentions(tokens[iterator],\n                                                          users, added_users)\n            if user_id is not None:\n                mentioned_users_id.append(user_id)\n\n    text = ' '.join(tokens)\n\n    # Check and convert link format\n    text, has_link = convert_link_format(text)\n    # convert `<mailto:foo@foo.com>` to `mailto:foo@foo.com`\n    text, has_mailto_link = convert_mailto_format(text)\n\n    if has_link is True or has_mailto_link is True:\n        message_has_link = True\n    else:\n        message_has_link = False\n\n    return text, mentioned_users_id, message_has_link\n\ndef get_user_mentions(token: str, users: List[ZerverFieldsT],\n                      added_users: AddedUsersT) -> Tuple[str, int]:\n    slack_usermention_match = re.search(SLACK_USERMENTION_REGEX, token, re.VERBOSE)\n    short_name = slack_usermention_match.group(4)\n    slack_id = slack_usermention_match.group(2)\n    for user in users:\n        if (user['id'] == slack_id and user['name'] == short_name and short_name) or \\\n           (user['id'] == slack_id and short_name is None):\n                full_name = get_user_full_name(user)\n                user_id = added_users[slack_id]\n                mention = \"@**\" + full_name + \"**\"\n                token = re.sub(SLACK_USERMENTION_REGEX, mention, token, flags=re.VERBOSE)\n                return token, user_id\n    return token, None\n\n# Map italic, bold and strikethrough markdown\ndef convert_markdown_syntax(text: str, regex: str, zulip_keyword: str) -> str:\n    \"\"\"\n    Returns:\n    1. For strikethrough formatting: This maps Slack's '~strike~' to Zulip's '~~strike~~'\n    2. For bold formatting: This maps Slack's '*bold*' to Zulip's '**bold**'\n    3. For italic formatting: This maps Slack's '_italic_' to Zulip's '*italic*'\n    \"\"\"\n    for match in re.finditer(regex, text, re.VERBOSE):\n        converted_token = (match.group(1) + zulip_keyword + match.group(3)\n                           + match.group(4) + zulip_keyword + match.group(6))\n        text = text.replace(match.group(0), converted_token)\n    return text\n\ndef convert_link_format(text: str) -> Tuple[str, bool]:\n    \"\"\"\n    1. Converts '<https://foo.com>' to 'https://foo.com'\n    2. Converts '<https://foo.com|foo>' to 'https://foo.com|foo'\n    \"\"\"\n    has_link = False\n    for match in re.finditer(LINK_REGEX, text, re.VERBOSE):\n        converted_text = match.group(0).replace('>', '').replace('<', '')\n        has_link = True\n        text = text.replace(match.group(0), converted_text)\n    return text, has_link\n\ndef convert_mailto_format(text: str) -> Tuple[str, bool]:\n    \"\"\"\n    1. Converts '<mailto:foo@foo.com>' to 'mailto:foo@foo.com'\n    2. Converts '<mailto:foo@foo.com|foo@foo.com>' to 'mailto:foo@foo.com'\n    \"\"\"\n    has_link = False\n    for match in re.finditer(SLACK_MAILTO_REGEX, text, re.VERBOSE):\n        has_link = True\n        text = text.replace(match.group(0), match.group(1))\n    return text, has_link\n", "path": "zerver/lib/slack_message_conversion.py"}]}