[WIP] Add handling possible short mentions tags to ExpensiMark #824
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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@[email protected]
"test@<a href=\"mailto:[email protected]\">[email protected]</a>"
"test@here<mention-short>@gmail.com</mention-short>"
[email protected]@gmail.com
<a href=\"mailto:[email protected]\">[email protected]</a>@gmail.com
<a href=\"mailto:[email protected]\">[email protected]</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
QA