-
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
Implement Block quote HTML to markdown conversion #4188
Comments
Triggered auto assignment to @zanyrenney ( |
Triggered auto assignment to @pecanoro ( |
Triggered auto assignment to @SofiedeVreese ( |
Hi, I would like to work on this issue. Here is my proposal:
I have a question. I'm assuming that we're already calling HTML to markdown conversion function when a rich text is pasted from Slack. Is that right? |
I'm out of office- readding External label to reassign. |
Triggered auto assignment to @jboniface ( |
Triggered auto assignment to @deetergp ( |
Proposal
{
name: 'quote',
regex: /\n?<(blockquote|q)(?:"[^"]*"|'[^']*'|[^'">])*>((?:.|\n)*?)<\/\1>(?![^<]*(<\/pre>|<\/code>))/gi,
replacement: (match, g1, g2) => {
const resultString = g2.trim().split('\n').map(m => `> ${m}`).join('\n')
return `\n${resultString}\n`;
}
}, |
This GH seems to assume that there will be something in the paste buffer when you copy block-quoted text out of slack. But when I dump some lorem ipsum into a blockquote in Slack, copy it to the buffer, then dump it into terminal, there's nothing. And if I dump it into Google Docs, it retains a bit of the background color from Slack, but nothing else that would indicate a blockquote. Am I missing something here? |
terminal only supports plain text. HTML formatting it lost while pasting. Github| Slack accepts HTML formatting thus they remain quoted |
Ah, I see. The problem was with how much I was selecting to copy from Slack. If I include the timestamp, then pasting it back into Slack includes the block-quoting. @parasharrajat Can you show me an example of what your solution does that @tugbadogan's does not? |
Yeah, @deetergp. Take this as example
Blockquote can contain newlines between text. you paste a quote with newlines in expensify as
My regex will handle multi-lines as well. Now there could be an existing line break before the Quote while pasting. We always surround the quote with new lines. and if there was an existing newline before the quote while pasting then we should not add another newline before the quote. My solution handles that as well. She just missed this part. |
That does seem rather important @parasharrajat, let's go with your solution. |
@deetergp, @jboniface it looks like no one is assigned to work on this job. |
I don't know why melvin is spamming that message when this is already hired out 🤔 |
This is paid and can be closed. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Related to #3047, similar to Expensify/expensify-common#392. Blockquote MD->HTML version can be found here
Action Performed:
Copied a blockquote message from slack to E.cash
Expected Result:
The message should contain markdown to create a blockquote in E.cash
Actual Result:
Message just pasted text
Platform:
Where is this issue occurring?
View all open jobs on Upwork
view this job on Upwork
The text was updated successfully, but these errors were encountered: