Skip to content
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

Modify regex in textToMarkdown functionality #576

Closed
wants to merge 2 commits into from

Conversation

jaylalakiya
Copy link

Fixed Issues

$ Expensify/App#27445

Tests

Following tests are related to changes I made and I needed to modify them because that's the correct behaviour (to have space before in in the first test and before in in the second test.

  1. test('Test html to heading1 markdown when h1 tag is in the beginning of the line', () => {
    const testString = '<h1>heading1</h1> in the beginning of the line';
    const resultString = '# heading1\n'
    + 'in the beginning of the line';
    expect(parser.htmlToMarkdown(testString)).toBe(resultString);
    });
  2. test('Test html to heading1 markdown when h1 tags are in the middle of the line', () => {
    const testString = 'this line has a <h1>heading1</h1> in the middle of the line';
    const resultString = 'this line has a\n'
    + '# heading1\n'
    + 'in the middle of the line';
    expect(parser.htmlToMarkdown(testString)).toBe(resultString);
    });

QA

  1. Open any chat
  2. Type # sometext
    someothertext
  3. Send the message and it should preserve the whitespace before second line.
  4. Now create another message with text # sometext
    someothertext
  5. Send the message and it should remove the whitespace before first line but it should preserve it in front of second line.

@jaylalakiya jaylalakiya requested a review from a team as a code owner September 15, 2023 04:08
@github-actions
Copy link

github-actions bot commented Sep 15, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@melvin-bot melvin-bot bot requested review from srikarparsi and removed request for a team September 15, 2023 04:09
@jaylalakiya
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@srikarparsi
Copy link
Contributor

Hey @jaylalakiya, your proposal has to be accepted by @parasharrajat and an internal engineer before your PR can be reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants