-
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 2021-09-16] Desktop - Big empty space in message fields if copy/paste the Text from MAC Note.app #4484
Comments
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open
|
Triggered auto assignment to @bondydaa ( |
I am OOO |
@parasharrajat - just checking, it looks like you were aware of this issue, correct? Was there a separate GH issue that was opened to track the bug where newlines are prepended to messages pasted into the message box? |
No, a new issue was not opened at that time. I was waiting for #4363 to merge as only after that, this behaviour is revealed. About the main issue, let me quickly take a good peek at it. Only then I can tell what is causing this much space. |
I think we should demote this from deploy blocker to regular-old 🐛 |
This hasn't been looked at in 9 days and has no assignee. Bumping to daily and making it External so we do something. |
Triggered auto assignment to @kadiealexander ( |
@parasharrajat is this related at all to #4759? |
@kadiealexander #4759 is needed to improve the parsing. But I was not able to reproduce the same behavior of this issue. There is space between pasted text but not before or after. |
After fixing #4759, note-fix.mp4 |
What version are you working with @parasharrajat? I just tested on version 1.0.85-9 (1.0.85-9) and I still see the white space above the message: 2021-08-23_11-21-10.mp4 |
Ok. I think it's specific to chrome. Let me retest. @kadiealexander EDIT: it may be note.app version. My Note.app version is 4.7 Sorry I got it now. It is reproducible now. |
Mine was on desktop app too, just FYI for the thread. Thanks for helping me troubleshoot it @parasharrajat! Will post to UW now :) |
I have found the fix as well. Preparing the proposal now. |
ExplanationWe faced an issue before where there were extra spaces on the Windows platform as windows surround the pasted HTML between <html>\n
<body>\n
asdasdsadsadsad
</body>\n
</html>\n While we trim all these extra tags but all those newlines are being prepended which creates a big empty space. Proposal
{
name: 'Strip Special Tags',
regex: /(\n|\r\n)?<\/?(html|body)(?:"[^"]*"|'[^']*'|[^'"><])*>(?![^<]*(<\/pre>|<\/code>))(\n|\r\n)?/gim,
replacement: ''
}, Instead in let generatedMarkdown = htmlString;
const body = /<(body)(?:"[^"]*"|'[^']*'|[^'"><])*>(?:\n|\r\n)?([\s\S]*?)(?:\n|\r\n)?<\/\1>(?![^<]*(<\/pre>|<\/code>))/im;
const parseBodyTag = generatedMarkdown.match(body);
if(parseBodyTag){
generatedMarkdown = parseBodyTag[2];
} This will trim the Extra newlines. At last, I suggest we should use a mature html-to-md parser. Otherwise, we will have many bugs like this. |
Upwork job: https://www.upwork.com/jobs/~01078e92ead30d76a6 |
Triggered auto assignment to @johnmlee101 ( |
@johnmlee101 when you get a moment, would you mind reviewing the existing proposals here? |
Love the proposal @parasharrajat . @kadiealexander feel free to assign out the job! |
@parasharrajat, I've hired you in Upwork! Please go ahead with your PR 😊 |
Bumping back to weekly while we wait for this to close out |
I am on vacation. back on 8. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by @johnmlee101 in version: 1.0.94-2 🚀
|
🚀 Deployed to production by @yuwenmemon in version: 1.0.95-1 🚀
|
@kadiealexander Any update for Upwork? |
Sorry @parasharrajat, timezones meant this fell on my weekend! I've paid this now. 💸 |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Issue was found when executing the PR #4363
Action Performed:
Expected Result:
Only entered message should be visible in compose field if copy/paste the Text from MAC Note.app
Actual Result:
Big empty space in message compose field if copy/past the Text from MAC Note.app
Workaround:
Unknown
Platform:
Where is this issue occurring?
Version Number:
v1.0.83-0
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
Bug5182815_empty.mp4
Expensify/Expensify Issue URL:
View all open jobs on Upwork
The text was updated successfully, but these errors were encountered: