Skip to content

[Due for payment 2025-09-12] [Due for payment 2025-09-02] [$250] Chat - Strikethrough not applied to blockquote text in preview, but applied in conversation #68518

Closed

Description

@jponikarchuk

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


Version Number: V9.1.94-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://test-management.browserstack.com/projects/2219752/test-runs/TR-272/folder/13176723/41237032/839723869
Email or phone of affected tester (no customers): Slottwo1 2@gmail.com
Issue reported by: Applause Internal Team
Device used: Redminote 10s android 13
App Component: Chat Report View

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Open a chat
  3. Paste the text
    ~ Test

Test
Test~

  1. Send the message

Expected Result:

The preview view and conversation view should be consistent.

Actual Result:

In preview, strike through is not applied for quote markdown text but in conversation view, strike through markdown is applied.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021956328079456092450
  • Upwork Job ID: 1956328079456092450
  • Last Price Increase: 2025-08-15
Issue OwnerCurrent Issue Owner: @ikevin127

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 14, 2025
  2. melvin-bot commented on Aug 14, 2025

    @melvin-bot

    Triggered auto assignment to @isabelastisser (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. aadil42 commented on Aug 14, 2025

    @aadil42
    Contributor

    @jponikarchuk the text provided in the OP is not consistent with the one used in the video. Can you give me that text?

  4. jponikarchuk commented on Aug 14, 2025

    @jponikarchuk
    Author

    @aadil42 The text provided in the OP is correct too

    bandicam.2025-08-14.11-50-53-332.mp4
  5. dmkt9 commented on Aug 14, 2025

    @dmkt9
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    In preview, strike through is not applied for quote markdown text but in conversation view, strike through markdown is applied.

    What is the root cause of that problem?

    1. Since blockquote in react-native-live-markdown is styled with display: 'inline-block':
      https://github.com/Expensify/react-native-live-markdown/blob/c5aeea4397e29012241f6e0aa934e11f75c36350/src/web/utils/blockUtils.ts#L58-L62

    2. In the OP’s case, strikethrough is used outside and fully wraps the blockquote, so it gets rendered first and becomes the parent of the blockquote's span. However, because blockquote is set to inline-block, the styles from the strikethrough's span don’t cascade down to the blockquote's span.

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

    In this case, we should check whether the blockquote is wrapped by a strikethrough. If it is, we can manually apply the strikethrough styles to the blockquote’s span.
    https://github.com/Expensify/react-native-live-markdown/blob/c5aeea4397e29012241f6e0aa934e11f75c36350/src/web/utils/parserUtils.ts#L238

    + const parsedLineMarkdownRanges = [] as MarkdownRange[];

    https://github.com/Expensify/react-native-live-markdown/blob/c5aeea4397e29012241f6e0aa934e11f75c36350/src/web/utils/parserUtils.ts#L266

    + if (
    +     range.type === 'blockquote' &&
    +     parsedLineMarkdownRanges.some((prevLine) => prevLine.type === 'strikethrough' && prevLine.start <= range.start && prevLine.length + prevLine.start >= range.start + range.length)
    + ) {
    +     addStyleToBlock(span, 'strikethrough', markdownStyle, isMultiline);
    + }

    https://github.com/Expensify/react-native-live-markdown/blob/c5aeea4397e29012241f6e0aa934e11f75c36350/src/web/utils/parserUtils.ts#L300

    +    parsedLineMarkdownRanges.push(range);
    }

    Note: We can review other markdown combinations that may require similar manual handling and apply this approach where necessary.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    NA

    What alternative solutions did you explore? (Optional)

    1. Option 1: Add textDecoration: 'inherit' style to blockquote:
      With this approach, we need to apply textDecoration: 'inherit' to all elements that might wrap around a blockquote, such as bold, italic, etc.
      https://github.com/Expensify/react-native-live-markdown/blob/c5aeea4397e29012241f6e0aa934e11f75c36350/src/web/utils/blockUtils.ts#L58

    2. Option 2: Remove the inline-block style from blockquote:
      https://github.com/Expensify/react-native-live-markdown/blob/c5aeea4397e29012241f6e0aa934e11f75c36350/src/web/utils/blockUtils.ts#L62

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 15, 2025
  7. changed the title [-]Chat - Strikethrough not applied to blockquote text in preview, but applied in conversation[/-] [+][$250] Chat - Strikethrough not applied to blockquote text in preview, but applied in conversation[/+] on Aug 15, 2025
  8. melvin-bot commented on Aug 15, 2025

    @melvin-bot
  9. melvin-bot commented on Aug 15, 2025

    @melvin-bot

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

  10. ikevin127 commented on Aug 16, 2025

    @ikevin127
    Contributor

    @dmkt9's proposal looks good to me, the RCA is correct and the proposed main solution fixes the issue following existing patterns within the react-native-live-markdown library.

    Screen.Recording.2025-08-15.at.16.53.15.mov

    Additionally I tested the changes directly in the react-native-live-markdown library to ensure all tests are still passing 🟢
    Noting that the issue is only present in web-based platforms, this issue is not reproducible on Native.

    This will require a react-native-live-markdown PR first, then a version bump PR for Expensify/App. For the react-native-live-markdown I suggest adding the following webParser tests to cover the new logic proposed in the main solution:

    Tests DIFF
    diff --git a/src/__tests__/webParser.test.tsx b/src/__tests__/webParser.test.tsx
    index fbc77fd..d962902 100644
    --- a/src/__tests__/webParser.test.tsx
    +++ b/src/__tests__/webParser.test.tsx
    @@ -296,3 +296,41 @@ describe('trailing whitespace', () => {
         });
       });
     });
    +
    +describe('strikethrough with blockquote combinations', () => {
    +  test('strikethrough spanning over blockquote text', () => {
    +    expect('~test\n> test\ntest~').toBeParsedAsHTML(
    +      '<p data-type="line" data-id="0"><span data-type="syntax" data-id="0,0"><span data-type="text" data-id="0,0,0">~</span></span><span data-type="strikethrough" data-id="0,1"><span data-type="text" data-id="0,1,0">test</span></span></p><p data-type="line" data-id="1"><span data-type="strikethrough" data-id="1,0"><span data-type="blockquote" style="text-decoration: line-through;" data-id="1,0,0"><span data-type="syntax" data-id="1,0,0,0"><span data-type="text" data-id="1,0,0,0,0">&gt;</span></span><span data-type="text" data-id="1,0,0,1"> test</span></span></span></p><p data-type="line" data-id="2"><span data-type="strikethrough" data-id="2,0"><span data-type="text" data-id="2,0,0">test</span><span data-type="syntax" data-id="2,0,1"><span data-type="text" data-id="2,0,1,0">~</span></span></span></p>',
    +    );
    +  });
    +
    +  test('single line strikethrough with blockquote inside', () => {
    +    expect('~> test content~').toBeParsedAsHTML(
    +      '<p data-type="line" data-id="0"><span data-type="syntax" data-id="0,0"><span data-type="text" data-id="0,0,0">~</span></span><span data-type="strikethrough" data-id="0,1"><span data-type="text" data-id="0,1,0">&gt; test content</span></span><span data-type="syntax" data-id="0,2"><span data-type="text" data-id="0,2,0">~</span></span></p>',
    +    );
    +  });
    +
    +  test('multiple blockquotes within strikethrough - not valid strikethrough', () => {
    +    expect('~> first quote\n> second quote~').toBeParsedAsHTML(
    +      '<p data-type="line" data-id="0"><span data-type="text" data-id="0,0">~&gt; first quote</span></p><p data-type="line" data-id="1"><span data-type="blockquote" data-id="1,0"><span data-type="syntax" data-id="1,0,0"><span data-type="text" data-id="1,0,0,0">&gt;</span></span><span data-type="text" data-id="1,0,1"> second quote~</span></span></p>',
    +    );
    +  });
    +
    +  test('strikethrough not fully encompassing blockquote - not valid strikethrough', () => {
    +    expect('~test\n> not struck~ more').toBeParsedAsHTML(
    +      '<p data-type="line" data-id="0"><span data-type="text" data-id="0,0">~test</span></p><p data-type="line" data-id="1"><span data-type="blockquote" data-id="1,0"><span data-type="syntax" data-id="1,0,0"><span data-type="text" data-id="1,0,0,0">&gt;</span></span><span data-type="text" data-id="1,0,1"> not struck~ more</span></span></p>',
    +    );
    +  });
    +
    +  test('nested blockquotes within strikethrough', () => {
    +    expect('~>> nested quote~').toBeParsedAsHTML(
    +      '<p data-type="line" data-id="0"><span data-type="syntax" data-id="0,0"><span data-type="text" data-id="0,0,0">~</span></span><span data-type="strikethrough" data-id="0,1"><span data-type="text" data-id="0,1,0">&gt;&gt; nested quote</span></span><span data-type="syntax" data-id="0,2"><span data-type="text" data-id="0,2,0">~</span></span></p>',
    +    );
    +  });
    +
    +  test('blockquote with other formatting inside strikethrough', () => {
    +    expect('~> *bold* and _italic_~').toBeParsedAsHTML(
    +      '<p data-type="line" data-id="0"><span data-type="syntax" data-id="0,0"><span data-type="text" data-id="0,0,0">~</span></span><span data-type="strikethrough" data-id="0,1"><span data-type="text" data-id="0,1,0">&gt; </span><span data-type="syntax" data-id="0,1,1"><span data-type="text" data-id="0,1,1,0">*</span></span><span data-type="bold" data-id="0,1,2"><span data-type="text" data-id="0,1,2,0">bold</span></span><span data-type="syntax" data-id="0,1,3"><span data-type="text" data-id="0,1,3,0">*</span></span><span data-type="text" data-id="0,1,4"> and </span><span data-type="syntax" data-id="0,1,5"><span data-type="text" data-id="0,1,5,0">_</span></span><span data-type="italic" data-id="0,1,6"><span data-type="text" data-id="0,1,6,0">italic</span></span><span data-type="syntax" data-id="0,1,7"><span data-type="text" data-id="0,1,7,0">_</span></span></span><span data-type="syntax" data-id="0,2"><span data-type="text" data-id="0,2,0">~</span></span></p>',
    +    );
    +  });
    +});

    🎀👀🎀 C+ reviewed

  11. 35 remaining items

  12. changed the title [-][Due for payment 2025-09-02] [$250] Chat - Strikethrough not applied to blockquote text in preview, but applied in conversation[/-] [+][Due for payment 2025-09-12] [Due for payment 2025-09-02] [$250] Chat - Strikethrough not applied to blockquote text in preview, but applied in conversation[/+] on Sep 5, 2025
  13. melvin-bot commented on Sep 5, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.1-20 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2025-09-12. 🎊

    For reference, here are some details about the assignees on this issue:

    • @ikevin127 requires payment through NewDot Manual Requests
    • @dmkt9 requires payment (Needs manual offer from BZ)
  14. melvin-bot commented on Sep 5, 2025

    @melvin-bot

    @ikevin127 @isabelastisser The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  15. isabelastisser commented on Sep 7, 2025

    @isabelastisser
    Contributor

    BugZero Checklist:

    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • ikevin127 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:

    • ikevin127 If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

    • ikevin127 If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal Template
    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    Test:

    Do we agree 👍 or 👎

  16. isabelastisser commented on Sep 9, 2025

    @isabelastisser
    Contributor
  17. ikevin127 commented on Sep 9, 2025

    @ikevin127
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] 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: N/A: result of the original design coming from the react-native-live-markdown library.

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    1. Open app.
    2. Open a chat.
    3. Paste this text:
    ~Test
    > Quote
    Test~
    
    1. Send the message.
    2. Paste the message again in the composer and verify that the preview is consistent with the sent message.

    Do we agree 👍 or 👎.

  18. isabelastisser commented on Sep 12, 2025

    @isabelastisser
    Contributor

    Payment summary:

    C+ review: @ikevin127 owed $250 via NewDot
    ROLE: @dmkt9 paid $250 via Upwork (LINK)

  19. isabelastisser commented on Sep 12, 2025

    @isabelastisser
    Contributor

    All set!

  20. dmkt9 commented on Sep 12, 2025

    @dmkt9
    Contributor

    @isabelastisser Thanks. I have just requested payment on Upwork.

  21. twisterdotcom commented on Sep 16, 2025

    @twisterdotcom
    Contributor

    @ikevin127 has submitted payment for this report on ND here.

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

    Zapier Logs Run ID: 00040eee-6203-af3d-ad5f-a78e6b42ad91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions