-
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
Android anchor markdown format 40564 #42147
Android anchor markdown format 40564 #42147
Conversation
@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@@ -45,7 +45,9 @@ function setClipboardMessage(content: string) { | |||
if (!Clipboard.canSetHtml()) { | |||
Clipboard.setString(parser.htmlToMarkdown(content)); | |||
} else { | |||
const plainText = parser.htmlToText(content); | |||
const anchorRegex = /<a\s+(?:[^>]*?\s+)?href=['"](.*?)['"]/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we reuse this regex?
App/src/libs/ReportActionsUtils.ts
Line 403 in e8ae3c5
const regex = /<a\s+(?:[^>]*?\s+)?href="([^"]*)"/gi; |
@samilabud Also help to merge the latest main |
I have merged and did the change, but I found an error by accident (no related to this PR):
Sometimes this expensify.crashed.mp4We should put the transactionID as optional because is not always present like Can we correct it in this PR or how can we report it? |
@samilabud Please resolve lint error |
@@ -45,7 +45,10 @@ function setClipboardMessage(content: string) { | |||
if (!Clipboard.canSetHtml()) { | |||
Clipboard.setString(parser.htmlToMarkdown(content)); | |||
} else { | |||
const plainText = parser.htmlToText(content); | |||
const anchorRegex = /<a\s+(?:[^>]*?\s+)?href="([^"]*)"/gi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we create a CONST for this regex to avoid duplicated code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samilabud Please test again to make sure this regex also works well
@DylanDylann done!, please take another look. Extra testsMarkDown.MAC.Web.Chrome.Test.mp4MarkDown.Android.Test.mp4 |
Reviewer Checklist
Screenshots/VideosAndroid: Native && mWeb ChromeScreen.Recording.2024-05-21.at.16.01.37.moviOS: Native && mWeb SafariScreen.Recording.2024-05-21.at.15.58.13.movMacOS: Chrome / Safari && MacOS: DesktopScreen.Recording.2024-05-21.at.15.57.08.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Approved but holding since we are still in a merge freeze. |
✋ 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 https://github.com/chiragsalian in version: 1.4.76-0 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.76-7 🚀
|
Details
We are using navigator.clipboard to handle the copy if web client supports it, but Android Native do not support it and we use Clipboard library (@react-native-clipboard/clipboard) instead to handle the copy functionality (in the composer).
Inside the setClipboardMessage we should validate if the content is only an URL, if that we should use the markdown format Clipboard.setString(parser.htmlToMarkdown(content));, with this we going to have a standard copy of any link when using the composer.
Fixed Issues
$ #40564
PROPOSAL: #40564 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android.-.copied.link.format.test.mp4
Android: mWeb Chrome
Android.Chrome.-.copied.link.format.test.mp4
iOS: Native
Iphone.-.copied.link.format.test.mp4
iOS: mWeb Safari
IPhone.Safari.-.copied.link.format.test.mp4
MacOS: Chrome / Safari
MAC.Chrome.-.Copied.link.format.test.mp4
MacOS: Desktop
MAC.Desktop.-.copied.link.format.test.mp4