mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
The Slack text regexes match specific characters before and after the formatted string to ensure that they only match at word boundaries. However, because the capture groups consume each matching character, including the characters used to determine word boundaries, two formatted strings separated by a single matching character result in one string not being matched, as the trailing whitespace is already consumed and cannot also match as the leading pre-match whitespace for the next character. Switch to a look-ahead regex for the trailing word boundary characters. This is zero-width, and as such the next match can still also consume the same characters. This also fixes Slack webhook integrations' `test_message_with_complex_formatted_mentions` which was previously expecting false output. Fixes part of #30827.
19 KiB
19 KiB