Skip to content

Commit 431c193

Browse files
authored
fix(scribe): Correctly unfurl threads with & chars. (#5801)
1 parent f4dbcab commit 431c193

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

servers/fai/src/fai/utils/scribe/slack_thread_unfurler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88

99
def extract_slack_thread_urls(text: str) -> list[dict[str, str]]:
10-
slack_wrapped_pattern = r"<(https://[\w\-]+\.slack\.com/archives/(C[A-Z0-9]+)/p(\d+)(?:\?thread_ts=(\d+\.\d+))?(?:&cid=[A-Z0-9]+)?)(?:\|[^>]+)?>"
11-
plain_url_pattern = r"(?<!<)https://[\w\-]+\.slack\.com/archives/(C[A-Z0-9]+)/p(\d+)(?:\?thread_ts=(\d+\.\d+))?(?:&cid=[A-Z0-9]+)?(?![>\|])"
10+
slack_wrapped_pattern = r"<(https://[\w\-]+\.slack\.com/archives/(C[A-Z0-9]+)/p(\d+)(?:\?thread_ts=(\d+\.\d+))?(?:&(?:amp;)?cid=[A-Z0-9]+)?)(?:\|[^>]+)?>"
11+
plain_url_pattern = r"(?<!<)https://[\w\-]+\.slack\.com/archives/(C[A-Z0-9]+)/p(\d+)(?:\?thread_ts=(\d+\.\d+))?(?:&(?:amp;)?cid=[A-Z0-9]+)?(?![>\|])"
1212

1313
threads = []
1414
seen_urls = set()

0 commit comments

Comments
 (0)