Skip to content

[HOLD for payment 2023-05-25] [$1000] Line break before heading is missing in editing mode #17998

Closed

Description

@kavimuru

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Go to any chat
  2. Send a new comment
test

# heading
  1. Edit the comment and notice the text in editing composer is
test
# heading

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?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

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
  • Upwork Job URL: https://www.upwork.com/jobs/~01ea44f382867687f1
  • Upwork Job ID: 1651431771500584960
  • Last Price Increase: 2023-04-27

Activity

  1. added
    Daily
    Bug
    on Apr 26, 2023
  2. MelvinBot commented on Apr 26, 2023

    @MelvinBot
    Contributor

    Triggered auto assignment to @kadiealexander (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. MelvinBot commented on Apr 26, 2023

    @MelvinBot
    Contributor

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  4. dukenv0307 commented on Apr 26, 2023

    @dukenv0307
    Contributor

    Proposal

    Please 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 htmlToMarkdown function. htmlToMarkdown function use htmlToMarkdownRules to convert html tag to mark down

    const draftMessage = parser.htmlToMarkdown(this.props.draftMessage).trim();

    And htmlToMarkdownRules in ExpensiMark lib has a rule for h1 tag:

    name: 'heading1',
    regex: /\s*<(h1)(?:"[^"]*"|'[^']*'|[^'">])*>(.*?)<\/\1>(?![^<]*(<\/pre>|<\/code>))\s*/gi,
    replacement: '[block]# $2[block]',
    

    With this regex it replace \s*<h1> by [block]#. So all line break before heading is replaced by one line break.

    What changes do you think we should make in order to solve the problem?

    Replace regex rule for h1 in htmlToMarkdownRules by /<(h1)(?:"[^"]*"|'[^']*'|[^'">])*>(.*?)<\/\1>(?![^<]*(<\/pre>|<\/code>))/gi

    What alternative solutions did you explore? (Optional)

    NA

    Result

    Screencast.2023-04-26.17.17.42.mp4
  5. kadiealexander commented on Apr 27, 2023

    @kadiealexander
    Contributor

    Was able to reproduce:

    2023-04-27_15-38-08.mp4
  6. added
    External
    on Apr 27, 2023
  7. changed the title [-]Line break before heading is missing in editing mode[/-] [+][$1000] Line break before heading is missing in editing mode[/+] on Apr 27, 2023
  8. MelvinBot commented on Apr 27, 2023

    @MelvinBot
    Contributor
  9. MelvinBot commented on Apr 27, 2023

    @MelvinBot
    Contributor

    Current assignee @kadiealexander is eligible for the External assigner, not assigning anyone new.

  10. MelvinBot commented on Apr 27, 2023

    @MelvinBot
    Contributor

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External)

  11. added
    Help Wanted
    on Apr 27, 2023
  12. 45 remaining items

  13. kadiealexander commented on May 25, 2023

    @kadiealexander
    Contributor
  14. mountiny commented on May 25, 2023

    @mountiny
    Contributor

    Lets add the bonus as i was at AppJS

  15. Christinadobrzyn commented on May 25, 2023

    @Christinadobrzyn
    Contributor

    Paid out the jobs in Upwork

    @eh2077 - reporting bonus + speed bonus + contributor
    @eVoloshchak speed bonus + C+

    @eVoloshchak - can you let me know about a regression test? Thanks!

  16. mountiny commented on May 29, 2023

    @mountiny
    Contributor

    @eVoloshchak can you please follow up on the checklist above

    @Christinadobrzyn @eVoloshchak I dont think we need a regression test for this

  17. kadiealexander commented on May 30, 2023

    @kadiealexander
    Contributor

    Thanks for helping with this while I as away @Christinadobrzyn!!

  18. eVoloshchak commented on May 30, 2023

    @eVoloshchak
    Contributor

    Will finish the BZ checklist tomorrow
    I think the regression test is needed here, this is something that could easily break, will propose a solution

  19. eVoloshchak commented on May 31, 2023

    @eVoloshchak
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: Add h1 markdown expensify-common#468

    • The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: https://github.com/Expensify/expensify-common/pull/468/files#r1212251731

    • A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: This is a typical markdown issue, we already have an item in the reviewer checklist to catch similar issues sooner If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.

    • Determine if we should create a regression test for this bug. Thinking about it again, we don't need a regression test I think. We already have unit tests for this, no need to have a redundant manual test for something that's already automated

  20. Christinadobrzyn commented on May 31, 2023

    @Christinadobrzyn
    Contributor

    Sounds good! Thanks for clarifying about the regression test @eVoloshchak - I think this can be closed as complete. right?

    cc @mountiny

  21. kadiealexander commented on Jun 1, 2023

    @kadiealexander
    Contributor

    I agree @Christinadobrzyn, @mountiny if you disagree please reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions