zulip/zerver
m-e-l-u-h-a-n 830c4acedc markdown: Fix invalid mention bug for stream and stream topic mention.
Modifies `StreamPattern` and `StreamTopicPattern` to inherit
from InlineProcessor instead of Pattern. This change is done
because Pattern stopped checking for matching patterns as soon
as it found a match which was not a valid stream. Due to this
all the subsequent mention failed, even if they were valid.
This bug was only present in backend renderring due to
markdown.inlinepatterns.Pattern.

Due to above changes verbose_compile is no longer used for
precompiling STREAM_LINK_REGEX, STREAM_TOPIC_LINK_REGEX as
adds ^(.*?) and (.*?)$ which cause extra overhead of matching
pattern which is not required. With new InlineProcessor these
extra patterns at beggining and end are not required.
So, StreamPattern and StreamTopicPattern now define their own
__init__ method for precompiling the regex.

Fixes #17535.

These changes were tested locally in dev server and by adding
some new markdown tests to test these.
2021-03-23 01:28:30 -07:00
..
data_import import/export: Fix deprecated authentication method for Slack. 2021-03-08 12:56:37 -08:00
lib markdown: Fix invalid mention bug for stream and stream topic mention. 2021-03-23 01:28:30 -07:00
management python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
migrations display_settings: Allow user to set default_view. 2021-03-11 18:09:08 -08:00
openapi openapi: Remove add operation from op list of stream event. 2021-03-22 23:44:56 -07:00
templatetags python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
tests markdown: Fix invalid mention bug for stream and stream topic mention. 2021-03-23 01:28:30 -07:00
tornado docs: Add a document explaining email/push notifications. 2021-03-05 15:24:25 -08:00
views api: Support user_id in get_user_presence_endpoint. 2021-03-11 20:14:04 -08:00
webhooks sentry: Do not assume context lines exist in stacktrace. 2021-03-22 12:16:10 -07:00
worker invites: Delete old compat code in the invites queue worker. 2021-02-26 08:26:43 -08:00
__init__.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
apps.py python: Reformat with Black, except quotes. 2021-02-12 13:11:19 -08:00
context_processors.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
decorator.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
filters.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
forms.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
logging_handlers.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
middleware.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
models.py models: Make get_human_admin_users optionally not return realm owners. 2021-03-22 18:10:03 -07:00
signals.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00