-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HOLD for payment 2023-06-28] [$1000] When sending h_ello_ , only _ello_ is sent #20111
Comments
Triggered auto assignment to @tjferriss ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.When sending What is the root cause of that problem?The root cause of this issue is that the regex /(?!_blank")[^\W_]?_((?![\s_])[\s\S]*?[^\s_])_(?![^\W_])(?![^<]*(<\/pre>|<\/code>|<\/a>|_blank))/g of See regex test screenshot below ![]() What changes do you think we should make in order to solve the problem?To fix this issue, we should ensure the preceding of the starting underscore
To achieve it, we can change the regex /(?!_blank")[^\W_]?_((?![\s_])[\s\S]*?[^\s_])_(?![^\W_])(?![^<]*(<\/pre>|<\/code>|<\/a>|_blank))/g of /(\b_+|\b)(?!_blank")_((?![\s_])[\s\S]*?[^\s_])_(?![^\W_])(?![^<]*(<\/pre>|<\/code>|<\/a>|_blank))/g by removing So, the group 1 is underscores before ![]() We also change the replacement method from replacement: (match, g1) => (g1.includes('<pre>') || this.containsNonPairTag(g1) ? match : `<em>${g1}</em>`), to // We add g1 which is underscores or empty string back before the <em> tag
replacement: (match, g1, g2) => (g2.includes('<pre>') || this.containsNonPairTag(g2) ? match : `${g1}<em>${g2}</em>`), By doing so, the input
won't be translated into html and won't break existing unit test cases of expensify-common. Below test cases will be helpful to verify the solution
What alternative solutions did you explore? (Optional)To fix this issue we can use a capture group to wrap We can change the regex /(?!_blank")[^\W_]?_((?![\s_])[\s\S]*?[^\s_])_(?![^\W_])(?![^<]*(<\/pre>|<\/code>|<\/a>|_blank))/g of /(?!_blank")([^\W_]?)_((?![\s_])[\s\S]*?[^\s_])_(?![^\W_])(?![^<]*(<\/pre>|<\/code>|<\/a>|_blank))/g So, the group 1 is the legal character before We also change the replacement method from replacement: (match, g1) => (g1.includes('<pre>') || this.containsNonPairTag(g1) ? match : `<em>${g1}</em>`), to replacement: (match, g1, g2) => (g1 || g2.includes('<pre>') || this.containsNonPairTag(g2) ? match : `<em>${g2}</em>`), But there's a drawback of this solution because the regex doesn't skip matching early. For example, for following input
![]() |
@eh2077 We shouldn't parse |
@s-alves10 Yes, I was just doing markdown syntax comparing on other Apps. Many of them, like Slack and Github don’t parse it. So I covered it if we don't want to parse it also. |
📣 @code2learn! 📣
|
Job added to Upwork: https://www.upwork.com/jobs/~0182558b3d97b80b80 |
Current assignee @tjferriss is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr ( |
Triggered auto assignment to @amyevans ( |
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Reproduced and added External label. |
@mollfpr what do you think about @eh2077 proposal? #20111 (comment) |
@tjferriss thanks for the ping! I’ll give it feedback soon! |
@tjferriss @amyevans I have tested the @eh2077 and the proposal looks good to me! 🎀 👀 🎀 C+ reviewed! |
Bump @tjferriss @amyevans |
Shouldn't the automated tests be sufficient to catch any regressions in this case, instead of introducing a manual regression test? |
@amyevans Yes! I forgot about that. I guess we could skip the regression step. |
Friendly bump @tjferriss |
Triggered auto assignment to @flaviadefaria ( |
Bug0 Triage Checklist (Main S/O)
|
@flaviadefaria This is just due payment, if you could please handle (since TJ is OOO). Thanks! |
@flaviadefaria Thanks for checking the payment. I think bonus should be applicable based the timeline above. It looks like Kelvin had a bug then. Can you search Eric Han for my UW profile? |
I did and couldn't find it, can you link it here? |
Offers sent, I'll add the bonus once the offer is accepted. |
Accepted the offer, thank you @flaviadefaria |
@flaviadefaria Accepted the offer thanks! |
Paid! |
I wasn't paid for this issue. I'm the issue reporter |
Oh @s-alves10 I thought I had already paid you, sorry about that! I just sent you the offer in UW! |
I'll close this again now and will pay you as soon as you accept the offer :) |
@flaviadefaria |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
Normal text h_ello_ is sent
Actual Result:
Italic text ello is sent
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.22-0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Video_2023-06-01_124931.mp4
Recording.861.mp4
Expensify/Expensify Issue URL:
Issue reported by: @s-alves10
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1685635565083259
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: