Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[WIP] Add handling possible short mentions tags to ExpensiMark #824

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kicu
Copy link

@Kicu Kicu commented Dec 21, 2024

This is WIP

Details

The purpose of this PR is to add handling of (possible) short mention tags to ExpensiMark. The PR is work in progress but already handling most cases, but we need further discussions to finish this.

why "possible" short mentions

The only way for us to actually render short-mentions inside live-markdown (and other code using expensimark) we need to have a list of all possible mentions.
This list is not and should not be shared in any way to ExpensiMark, as this is just a parser. However in order to try to match a short mention to a list of actual users, we need some kind of output from ExpensiMark from parsing.

In this PR we define "short-mention" as anything after @ character that would be a valid email prefix.
However this creates multiple edge cases, because text that in the past would be considered just normal text, might now be a short mention.

Current edge cases (based on tests)

  • test@here@gmail.com
    • prev return: "test@<a href=\"mailto:here@gmail.com\">here@gmail.com</a>"
    • now returns: "test@here<mention-short>@gmail.com</mention-short>"
  • test@gmail.com@gmail.com
    • prev: <a href=\"mailto:test@gmail.com\">test@gmail.com</a>@gmail.com
    • now: <a href=\"mailto:test@gmail.com\">test@gmail.com</a><mention-short>@gmail.com</mention-short>

Some other cases can be seen in tests.

CC @puneetlath @tomekzaw @BartoszGrajdek

Fixed Issues

$ Expensify/App#38025

Tests

  1. What unit/integration tests cover your change? What autoQA tests cover your change?
  2. What tests did you perform that validates your changed worked?

QA

  1. What does QA need to do to validate your changes?
  2. What areas to they need to test for regressions?

Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@Kicu
Copy link
Author

Kicu commented Dec 21, 2024

I have read the CLA Document and I hereby sign the CLA

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant