zulip/zerver/lib/markdown
Zixuan James Li a3a0103d86 markdown: Calculate linkifier precedence in topics.
This uses the linkifier index among the list of linkifiers in the
replacement as the priority to order the replacement order for
patterns in the topic. This avoids having multiple overlapping matches
that each produce a link.

The linkifier with the lowest id will be prioritized when its pattern
overlaps with another. Linkifiers are prioritized over raw URLs.

Note that the same algorithm is used for local echoing and the
backend markdown processor.

Fixes #23715.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-12-13 15:16:20 -08:00
..
__init__.py markdown: Calculate linkifier precedence in topics. 2022-12-13 15:16:20 -08:00
api_arguments_table_generator.py markdown: Rename preprocessor_priorities module to priorities. 2022-06-26 17:36:31 -07:00
api_return_values_table_generator.py markdown: Fix rendering of nested objects in API return values. 2022-08-04 16:34:13 -07:00
fenced_code.py ruff: Fix N818 exception name should be named with an Error suffix. 2022-11-17 16:52:00 -08:00
help_emoticon_translations_table.py markdown: Rename preprocessor_priorities module to priorities. 2022-06-26 17:36:31 -07:00
help_relative_links.py markdown: Rename preprocessor_priorities module to priorities. 2022-06-26 17:36:31 -07:00
help_settings_links.py help: Update documentation on bots. 2022-10-18 10:16:42 -07:00
include.py ruff: Fix N818 exception name should be named with an Error suffix. 2022-11-17 16:52:00 -08:00
nested_code_blocks.py markdown: Rename preprocessor_priorities module to priorities. 2022-06-26 17:36:31 -07:00
priorities.py openapi: Fuse generate_api_title with generate_api_description. 2022-07-22 16:41:55 -07:00
tabbed_sections.py tabbed-sections: Update "via-user-profile" to be "via-user-card". 2022-11-14 12:16:22 -08:00
testing_mocks.py python: Reformat with Black, except quotes. 2021-02-12 13:11:19 -08:00