zulip-terminal
zulip-terminal copied to clipboard
[WIP]model/messages/api_types: alert_words mark up
What does this PR do?
Partial fix for #588
Tested?
- [X] Manually
- [X] Existing tests (adapted, if necessary)
- [X] New tests added (for any new behavior)
- [X] Passed linting & tests (each commit)
Commit flow
first commit:Fetches alert words and registers for any alert_word event and updates the alerts words.
second commit: adds transform_content_alert_words which adds <span class=alert-word> around alert-words
Notes
-> This PR(specifically the second commit) is based on the alert word implementation of the Zulip web client which was later adapted by other clients. link for the web implementation code: link -> Other helpful documentations for contributors: 1. regex wrt python 2. re module -> Whats Done?
- fetching and registering of alert_words
- finding the alert_word patterns and applying the
-> What needs to be done?
-
Even though applying span logic is ready but the logic for applying markup for alert words inside of multiple elements is not ready. So basically the markup works for the alert-words without any other
tags indiesoup2markup. Before that we have to decide whether we want to apply different markup when multiple tags are present for a alert_word or we have to choose the markup from any one of them. -
Currently the markup applied for alert-words is same as
codetag i.emsg_codeas the markup for differentzt_themesare yet to be discussed. -
Tests are not added as the non-test code is yet to reach a stable state.
@zulipbot add "PR needs review"
@Subhasish-Behera Is this awaiting an update from you, or have you addressed the feedback? Just checking based on my earlier feedback and that from Vishwesh :) (If so, you can add a 👍 emoji or a comment to specific comments to indicate this)