-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[$500] Markdown - Sending a message with two ">" characters replaces one ">" with a whitespace #34142
Comments
Job added to Upwork: https://www.upwork.com/jobs/~010d9e66996671f8b8 |
Triggered auto assignment to @mallenexpensify ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ntdiary ( |
I am interested to work on it |
ProposalPlease re-state the problem that we are trying to solve in this issue.When sending a message containing double ">" in any conversations, the second ">" gets replaced by an empty spaced. What is the root cause of that problem?The problem is comming from the function getParsedComment(text: string): string {
const parser = new ExpensiMark();
return text.length <= CONST.MAX_MARKUP_LENGTH ? parser.replace(text) : lodashEscape(text);
} Located in What changes do you think we should make in order to solve the problem?The Update: More specifically, by replacing the following regex inside the // Old Regex
/^>( )?/gm
// Suggested Regex
/^(>){,1}( )?/gm This way, we assure that the match happens only once and both of the What alternative solutions did you explore? (Optional)None. |
Proposal |
ProposalPlease re-state the problem that we are trying to solve in this issue.Sending quote markdown with double >> will not show the second > What is the root cause of that problem?When we are creating a message with markdown, it will call the ExpensiMark parser replace function. For quote, there are 2 cases, keeping any whitespace or trimming all whitespace. By default, adding a new comment will call the parser replace with trimming all whitespace. If we trim all whitespace, it will call If we send This worked fine before, but then, it will continue by calling the rules replacement logic that will also remove the So the final message becomes In summary, we have 2 cases of quote, keeping the whitespace or trimming it. Both cases will call the replacement logic which will remove the What changes do you think we should make in order to solve the problem?To fix this, we should have the
We need to trim it here because we already remove the |
Checking on summin' internally |
@ntdiary, @mallenexpensify Eep! 4 days overdue now. Issues have feelings too... |
ProposalPlease re-state the problem that we are trying to solve in this issue.Markdown - Sending a message with two ">" characters replaces one ">" with a whitespace What is the root cause of that problem?Before submit message we have getParsedComment, and this function is using ExpensiMark to replace the current message to markdown at this line What changes do you think we should make in order to solve the problem?At function let textToFormat = textToCheck.split('\n').map(row => row.trim()).join('\n'); What alternative solutions did you explore? (Optional) |
Checking a different spot internally to see what we want to do here |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@ntdiary, @mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Waiting for the result of the internal discussion. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Going to close for now since it's a tiny bug and not directly related to a VIP or wave project on our roadmap |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.4.23-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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
Action Performed:
Expected Result:
One of the ">" characters should not be replaced with a white space
Actual Result:
One of the ">" characters becomes replaced by a whitespace
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6336731_1704809430448.quote.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: