-
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
fix: email new line by skipping extra div #13503
Conversation
there is an issue with login in development env as mentioned here so I can't provide all video in MWeb since I am not login there. @aimane-chnaif if you want you can do an initial code review until this issue is fixed . |
@ahmdshrif PR is still in draft. when is it marked as review? I see you already added web/mWeb screenshots but iOS screenshot is missing |
@aimane-chnaif I have an issue with running on ios. looks like it's a cache dependency issue with. but I think we do not need ios or android since this issue does not affect native and the code we change is only working on the web.
![Screenshot 2022-12-15 at 3 44 21 PM](https://user-images.githubusercontent.com/21364901/207874415-1e727a8f-f910-4acd-b465-7710898eb6fb.png)
|
ok, please fix soon and complete PR so I can review immediately. |
@Julesssss @aimane-chnaif One of you needs to 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] |
@aimane-chnaif it's ready now |
@ahmdshrif please update testing step like this: (Emails are hyperlinked automatically, no need markdown) Also And Please thoroughly check and fix any spelling or space mistakes in PR description. |
@aimane-chnaif update it ... I copied the steps from the issue. but now correct it. |
src/libs/SelectionScraper/index.js
Outdated
// skip useless div because it's doing some issues on reconverting the HTML to markdown | ||
// and we skip it only if:- | ||
// 1- not contain specific attributes | ||
// 2- have only one child and not a text |
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.
also fix here including any spelling or grammatical mistakes in comment
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.
I was thinking about updating comment to this comment:-
// We are excluding divs that have only one child and no text nodes and don't have a tagAttribute.
// This is due to the fact that these divs are meaningless to us and are interfering with the HTML to Markdown conversion process.
// For example, the following HTML :
// <div><div> hi </div></div>
// we will return as :
// <div> hi </div>
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.
@aimane-chnaif I update the comment but delete the example above I think we not need it.
@ahmdshrif please add step in |
done . @aimane-chnaif |
Edit: ah sorry, I see you added |
@aimane-chnaif np, and I agree it's better to be Step 2 I update it. |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Safarimsafari.mp4Desktopdesktop.moviOSios.mp4 |
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.
Tests well for me
All yours @Julesssss
src/libs/SelectionScraper/index.js
Outdated
// We are excluding divs that have only one child and no text nodes and don't have a tagAttribute. | ||
// This is due to the fact that these divs are meaningless to us and are interfering with the HTML to Markdown conversion process. |
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.
and don't have a tagAttribute
Is that true? I can't see which condition this is referring to
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.
else condition
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.
Slight re-wording:
We are excluding divs that have only one child and no text nodes and don't have a tagAttribute to prevent additional newlines from being added in the HTML to Markdown conversion process.
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.
I just think this is the case we catch but can be another case also not only a new line.
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.
@Julesssss but yes we just explain what we have now so i update the comment
Tests well, I used a bunch of random Markdown text in addition to the tests. Can't think of any additional things to regression test. |
Performance Comparison Report 📊Significant Changes To DurationThere are no entries Meaningless Changes To DurationShow entries
Show details
|
🚀 Deployed to staging by @Julesssss in version: 1.2.41-1 🚀
|
🚀 Deployed to production by @yuwenmemon in version: 1.2.41-4 🚀
|
Hello @ahmdshrif. Coming from #16921 (comment). I have a question regarding this PR: Why do we skip |
Hi @tienifr, sorry for the late response. I was sick leave. If you delete the text condition, some div response to new line will be skipped I write this comment from mobile, and i will comment on the issue soon with more examples and details. |
@ahmdshrif Take a look at this when you have some time. |
Details
Fixed Issues
$ #9250
PROPOSAL: #9250 (comment)
Tests
a@mail.com is my email. b@mail.com is someone else's email.
in composer and send it.Offline tests
a@mail.com is my email. b@mail.com is someone else's email.
in composer and send it.QA Steps
steps :
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.Screenshots/Videos
Web
Screen.Recording.2022-12-10.at.1.52.22.PM.mov
Mobile Web - Chrome
WhatsApp.Video.2022-12-14.at.11.59.39.PM.mp4
Mobile Web - Safari
Simulator.Screen.Recording.-.iPhone.14.-.2022-12-14.at.23.23.19.mp4
Desktop
Screen.Recording.2022-12-10.at.7.33.18.PM.mov
iOS
Simulator.Screen.Recording.-.iPhone.13.-.2022-12-15.at.17.11.22.mp4
Android
WhatsApp.Video.2022-12-15.at.12.05.47.AM.mp4