zulip-terminal icon indicating copy to clipboard operation
zulip-terminal copied to clipboard

[WIP]model/messages/api_types: alert_words mark up

Open Subhasish-Behera opened this issue 2 years ago • 2 comments

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?

  1. fetching and registering of alert_words
  2. finding the alert_word patterns and applying the

-> What needs to be done?

  1. 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 indie soup2markup. 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.

  2. Currently the markup applied for alert-words is same as code tag i.e msg_code as the markup for different zt_themes are yet to be discussed.

  3. Tests are not added as the non-test code is yet to reach a stable state.

Subhasish-Behera avatar Mar 02 '23 18:03 Subhasish-Behera

@zulipbot add "PR needs review"

Subhasish-Behera avatar Mar 25 '23 17:03 Subhasish-Behera

@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)

neiljp avatar Jul 04 '23 21:07 neiljp