-
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
[Hold for Payment June 19][$250] Workspace - Inconsistency in Block Quote Usage Between Workspace Description and Chat #40571
Comments
Triggered auto assignment to @isabelastisser ( |
@isabelastisser FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
We think that this bug might be related to #vip-vsp |
Job added to Upwork: https://www.upwork.com/jobs/~015e52952078f428b3 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Inconsistency in Block Quote Usage in text What is the root cause of that problem?App/src/pages/workspace/WorkspaceProfileDescriptionPage.tsx Lines 29 to 40 in c1827d8
For example What changes do you think we should make in order to solve the problem?Need to fix FYI, this problem also exists on chat, but if message is saved without changes, it does not call API. That's why this problem does not detected by @lanitochka17. If user edits a blockquote message on chat, it eats blockquotes too. What alternative solutions did you explore? (Optional)N/A |
The root cause of the problem is that the parser.htmlToMarkdown function does not correctly parse HTML. Specifically, when encountering nested elements, it produces incorrect Markdown output. |
@skyweb331 Thanks for your proposal! We look for detailed solutions, so you would need to propose what changes you would make to |
@jjcoffee I am going to use |
If these modules are too big, I can just copy ideas from those modules for parsing html. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Inconsistency in Block Quote Usage Between Workspace Description and Chat What is the root cause of that problem?then the page Currently, if we pass We need to fix this part here from expensify-common lib What changes do you think we should make in order to solve the problem?Here's an adjusted version of the code snippet that will handle the nested {
name: 'quote',
regex: /(<blockquote(?:[^>]*?)>)([\s\S]*?)(<\/blockquote>)/gi,
replacement: function replaceBlockquotes(match, openTag, content, closeTag, offset, string) {
// Recursively process nested blockquotes
content = content.replace(/(<blockquote(?:[^>]*?)>)([\s\S]*?)(<\/blockquote>)/gi, replaceBlockquotes);
// Split content into lines, trim and add quote markers
content = content
.split('\n')
.map(line => line.trim() ? `> ${line}` : '')
.join('\n');
// Add an extra '>' to each line to account for the current blockquote level
content = content
.split('\n')
.map(line => line ? `>${line}` : '> ')
.join('\n');
return content;
}
},
The Each line of the content inside a blockquote is prefixed with This revised method ensures that every nested As on chat, we can also check on Workspace description if the old value is equal to the new one. If true, we will not update the value in the database POC; 20240422_183810.mp4 |
@dragnoir I just tested your code against all testing cases on expensify-common but it fails... For example, |
123abc what was your input? before HTML |
|
What input did you texted inside the workspace description? like markdown not HTML |
|
Reviewing tomorrow! |
Proposal updateProposal updated to fix the issue of multi-lines quote. |
Unfortunately, I had higher priority issues to get to today. Tomorrow! |
Hey @jjcoffee, can you please review the updated proposal above? Thanks! |
PR is being reviewed here |
Any updates, @dragnoir ? |
@isabelastisser App PR is up, but we are waiting to proceed because an earlier PR to upgrade |
Thanks for the update, @jjcoffee ! |
There's a new PR that will bump |
@jjcoffee Would you mind testing related changes to this issue on the new PR? |
I think this is ready for payment! |
I think it should be 7 days post #42387 is deployed to production |
@blazejkustra I see it's already been merged, but I've given it a quick test run anyway and all looks good! desktop-chrome-retest-2024-06-06_10.25.39.mp4 |
Can't figure out what's going on here. @jjcoffee @MonilBhavsar can you provide an update? Is payment due to anyone? Thx |
@mallenexpensify #42387 bumped |
Waiting for payment due here. |
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Regression Test Proposal
Do we agree 👍 or 👎 |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.63-7
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): abebemiherat@gmail.com
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
The block quote should be displayed correctly in the workspace description section, like in chat, ensuring consistency
Actual Result:
When writing a block code example (">>abebe") in the workspace description, clicking on it and saving it without changes reduces one quote. However, this inconsistency does not occur in chat
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6454831_1713528210858.Screen_Recording_2024-04-19_at_4.59.16_AM.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @jjcoffeeThe text was updated successfully, but these errors were encountered: