-
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 July 20] Markdown - Copied text (with markdown) does not show the formatting when pasted in e.cash #3790
Comments
Triggered auto assignment to @tylerkaraszewski ( |
@tylerkaraszewski this can be worked on by a contributor, right? If so, can you add the |
Triggered auto assignment to @Jag96 ( |
Seems straightforward for an external contributor to work on. |
It is not straightforward but looks like so.
|
Feels like this one should hold until #3229? |
Reassigning @Jag96 |
I agree that this doesn't have to be held on #3229. Also, if we don't currently support lists I don't think we need to add that in this issue.
Just to confirm, we shouldn't have to do anything special to show the markdown in the composer right? We'd just have to ensure that when text is copied, the markdown version is copied to the clipboard. |
But when you copy only HTML flavour is available. You can quickly check it on Gmail. Web browser. |
Ah ok, so it sounds like #3047 will handle that conversion. Looping in @roryabraham here. |
Adding the Help Wanted label, as it looks like we're still looking for proposals here (please remove the label if we're not!) |
@roryabraham just bumping here, should this issue be held on #3047? |
I still think it's better to save the markdown and directly render it to HTML when needed. |
@Jag96 #3047 is about taking HTML that we've saved, and converting it to markdown for editing. I think this issue is different. I don't know for sure how copying formatted text works, but my guess is that both the plain-text and formatted (html) versions of the text are copied to the clipboard. If that's correct, I think we just need to make sure that the formatted html is pasted in E.cash, instead of the plain-text version. It will be a bit wonky because our main report action composer doesn't support HTML. So the raw HTML would be displayed in the composer, but then would display correctly formatted once sent. Does that make sense? |
From this comment it sounds like it's just HTML that is being copied at the moment, and after copying formatted HTML from e.cash into Notepad on mac it looks like some of the HTML is pasted.
From testing we don't convert raw HTML comments (ex
The investigation for saving markdown instead will take some time so for now I don't think that's an option in the short term. |
Ah, you're right! Imo this is a problem. We should be able to type html and have it displayed as formatted html. Just like how markdown and plain HTML work in GitHub. |
To clarify, you aren't saying that you can just type formatted HTML
into the compose box and expect it to work, right? I do not think that is
a goal, or even a good feature.
…On Tue, Jul 6, 2021 at 7:00 PM Rory Abraham ***@***.***> wrote:
From testing we don't convert raw HTML comments (ex *Test*) into
formatted HTML after posting
Ah, you're right! Imo this is a problem. We should be able to type html
and have it displayed as formatted html. Just like how markdown *and*
plain HTML work in GitHub.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3790 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEMNUVWAXPZGDKLXJ7UFVTTWOYMRANCNFSM47P3UEUA>
.
|
As per Rory's suggestion. Proposal
we can put this escaping behind a flag. Optional
I am looking into htmlparser2 for this as this lib is already used by |
Okay, if we do move forward with this plan, we'll want to be sure to strip
Yeah, so I tend to disagree. I love how in GH we can fallback on regular HTML. And it's basically free to implement – as @parasharrajat suggested we just need to stop escaping the HTML. It feels pretty arbitrary to me that this doesn't work already. If we don't want to support plain HTML, then this still doesn't need to be on hold on #3047. Instead, we would just take step 2 of @parasharrajat's proposal above, and run the pasted HTML through the HTML -> MD converter. And it would only work for HTML -> MD conversions we have built, which currently is just |
When we first created the Expensimark lib, we explicitly decided not to convert HTML to formatted HTML so that we could control everything that gets converted to HTML, you can see we even have a test for this: https://github.com/Expensify/expensify-common/blame/master/__tests__/ExpensiMark-test.js#L74 Updating the parser to not escape the HTML should be a separate discussion in #expensify-open-source since I don't think that is functionality we currently want to change. |
Ok Sure. Please let me know the best path forward. Thanks |
I think we've come full circle and the solution here should be what @parasharrajat suggested initially: It sounds like we only have one HTML->MD conversion built out already (#3790 (comment)), so to do this I think we'd need to add some more rules similar to what was done in Expensify/expensify-common#381 to do the other conversions (bold/italic/strikethrough). @parasharrajat are you interested in taking this on? |
@Jag96 Yes, I am interested. I will link PRs for supported tags to the Tracking issue and update you if I am stuck at something. |
Sounds great! I'll assign to you and invite you to the Upwork job, thanks |
Ok, how about we split this up into 2 issues:
Then the rest of the HTML->MD conversions can happen in #3047. How does that sound @parasharrajat? |
@Jag96 Sounds good. |
Created another issue here and invited @parasharrajat to the Upwork job. Used the italics conversion for the title, but feel free to choose any of the items from the tracking issue. |
Reopening to keep track of payment |
@Jag96 any update here? Thanks |
Paid! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Upwork job: https://www.upwork.com/jobs/~01784929033238eacd
Action Performed:
Bold text
italic text
Strikethrough textBullet points test
Another Bullet point
Indents test
Expected Result:
Formatting should be displayed in e.cash.
Actual Result:
Text is pasted without any formatting. Only line breaks are displayed.
Workaround:
User has to edit the text in e.cash compose box and add the markdown manually.
Platform:
Where is this issue occurring?
Web ✔️
iOS
Android
Desktop App
Mobile Web
Version Number: 1.0.74-0
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
Expensify/Expensify Issue URL:
View all open jobs on Upwork
From @mallenexpensify https://expensify.slack.com/archives/C01GTK53T8Q/p1617291564288600
The text was updated successfully, but these errors were encountered: