-
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 2023-05-25] [$1000] Line break before heading is missing in editing mode #17998
Comments
Triggered auto assignment to @kadiealexander ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Line break before heading is missing in editing mode What is the root cause of that problem?Draft message is display by
And htmlToMarkdownRules in ExpensiMark lib has a rule for h1 tag:
With this regex it replace What changes do you think we should make in order to solve the problem?Replace regex rule for What alternative solutions did you explore? (Optional)NA ResultScreencast.2023-04-26.17.17.42.mp4 |
Was able to reproduce: 2023-04-27_15-38-08.mp4 |
Job added to Upwork: https://www.upwork.com/jobs/~01ea44f382867687f1 |
Current assignee @kadiealexander is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak ( |
Triggered auto assignment to @mountiny ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Line break before heading is missing in editing mode What is the root cause of that problem?When editing a comment, we call method htmlToMarkdown to convert draftMessage which is equal to
The initial draft message test<br /><h1>heading</h1> is converted to
by applying newline rule
by applying html-heading1-to-markdown-heading rule.
Based on the above analysis, the root cause is that the line break before heading is eliminated in html-heading1-to-markdown-heading rule. regex: /\s*<(h1)(?:"[^"]*"|'[^']*'|[^'">])*>(.*?)<\/\1>(?![^<]*(<\/pre>|<\/code>))\s*/gi, matches the What changes do you think we should make in order to solve the problem?To fix this issue, we should retain line break before heading1. To achieve this, we should match whitespaces but not newlines before string So the new regex for html-heading1-to-markdown-heading rule is regex: /[^\S\r\n]*<(h1)(?:"[^"]*"|'[^']*'|[^'">])*>(.*?)<\/\1>(?![^<]*(<\/pre>|<\/code>))\s*/gi, What alternative solutions did you explore? (Optional)Can we just remove the prefix regex
which is test case from the lib expensify-common. |
@dukenv0307, I don't think we should remove the @eh2077, thank's for the analysis and a detailed explanation, I think that's the correct approach.
is turned into
|
@eVoloshchak Sure. I think we can fix the issue of removing line break after heading as well if it’s not an intended feature the product team want. |
Yeah let's fix that and prevent the automatic removal of line breaks too, please! |
Hi @eVoloshchak , as @kadiealexander has confirmed we should fix the removing ending line breaks issue too, I think we can apply the same regex piece to fix both removing line breaks issue together. And I found another reason that we should them is that we apply newline rule before heading rule, so it's obviously buggy to removing starting and ending line breaks of heading. |
@eh2077, sounds good, let's get the PR going |
📣 @eh2077 You have been assigned to this job by @kadiealexander! |
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
@eVoloshchak please don't forget the checklist above! Assigned: May 8th 2023 10:52am (GMT+12) Offers sent to @eh2077 for job + reporting bonus, and @eVoloshchak for C+. |
Reassigning to get this paid tomorrow as I'm OOO. |
Triggered auto assignment to @Christinadobrzyn ( |
Current assignee @eVoloshchak is eligible for the External assigner, not assigning anyone new. |
Current assignee @mountiny is eligible for the External assigner, not assigning anyone new. |
Thanks @Christinadobrzyn! |
Lets add the bonus as i was at AppJS |
Paid out the jobs in Upwork @eh2077 - reporting bonus + speed bonus + contributor @eVoloshchak - can you let me know about a regression test? Thanks! |
@eVoloshchak can you please follow up on the checklist above @Christinadobrzyn @eVoloshchak I dont think we need a regression test for this |
Thanks for helping with this while I as away @Christinadobrzyn!! |
Will finish the BZ checklist tomorrow |
|
Sounds good! Thanks for clarifying about the regression test @eVoloshchak - I think this can be closed as complete. right? cc @mountiny |
I agree @Christinadobrzyn, @mountiny if you disagree please reopen. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
The line break before heading shouldn't be missing
Actual Result:
The line break before heading is missing
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.5-5
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Recording.363.mp4
Screen.Recording.2023-04-25.at.10.07.09.AM.mov
Expensify/Expensify Issue URL:
Issue reported by: @eh2077
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1682388776064199
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: