zulip/zerver/lib/markdown
m-e-l-u-h-a-n 1b8a5a3344 markdown: Refactor backend logic for handling user mention.
Backend logic for handling user mention was cluttered
because it was handled at two stages first in
get_possible_mentions_info while fetching mention data
based on the messsage and then later in UserMentionPattern
which handles processing of text for mention.

Ideally UserMentionPattern should depend on
get_possible_mentions_info only for data but there was a
shared logic between these two that made it hard to debug
any possible bugs.

Updates in this commit make both of these functions
coherent in terms of logic and also add appropiate
comments to improve readability of these functions.

There was also a hidden bug that if a user A is
mentioned in with @**name|id** then @**invalid|id**
again mentioned A because of the way we handled mentions
earlier. It is solved as a result of this refactor and
appropiate test has been added for this.

This has been tested manually as well as by adding new
test to address missing case.
2021-03-28 16:52:48 -07:00
..
__init__.py markdown: Refactor backend logic for handling user mention. 2021-03-28 16:52:48 -07:00
api_arguments_table_generator.py api docs: Expand checking for deprecated fields. 2021-02-16 15:34:52 -08:00
api_return_values_table_generator.py api docs: Sort response keys in /get-events. 2021-02-26 15:01:37 -08:00
fenced_code.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
help_emoticon_translations_table.py mypy: Correct typing.re imports to typing. 2021-03-17 18:41:46 -07:00
help_relative_links.py mypy: Correct typing.re imports to typing. 2021-03-17 18:41:46 -07:00
help_settings_links.py mypy: Correct typing.re imports to typing. 2021-03-17 18:41:46 -07:00
include.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
nested_code_blocks.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
tabbed_sections.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
testing_mocks.py python: Reformat with Black, except quotes. 2021-02-12 13:11:19 -08:00