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

Improve markdown italicizing when following tags #695

Merged
merged 2 commits into from
May 29, 2024

Conversation

skyweb331
Copy link
Contributor

@skyweb331 skyweb331 commented May 14, 2024

Fixed Issues

$ Expensify/App#41110
This PR is to fix italicizing the context which are following <code>,<pre>,<a> tags in one line.

Tests

  1. What unit/integration tests cover your change? What autoQA tests cover your change?
    Passed all existing test cases and Added one more test case for this purpose.
  2. What tests did you perform that validates your changed worked?
    bump expensify-common version in E/App and react-native-live-markdown to this PR and tested locally
    330365055-4134416a-eb49-42fc-8884-697b7f265cee

QA

  1. What does QA need to do to validate your changes?
    bump expensify-common version in E/App and use chat normally - sent messages should be parsed with the new rule
  2. What areas do they need to test for regressions?
    Italic markdown following <code>,<pre>,<a>,<mention-user> tags in one line

@skyweb331 skyweb331 requested a review from a team as a code owner May 14, 2024 09:24
Copy link

github-actions bot commented May 14, 2024

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

@melvin-bot melvin-bot bot requested review from marcochavezf and removed request for a team May 14, 2024 09:25
@skyweb331
Copy link
Contributor Author

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

@marcochavezf marcochavezf requested review from thienlnam and removed request for marcochavezf May 14, 2024 17:01
@thienlnam
Copy link
Contributor

Could you please fill out the issue description?

@thienlnam
Copy link
Contributor

Additionally, the GH_LINK text should be replaced with the link Expensify/App#41110 so it would be $ Expensify/App#41110

@thienlnam
Copy link
Contributor

@sobitneupane I can't seem to assign you here, so you might have to comment on the issue first

@skyweb331
Copy link
Contributor Author

Additionally, the GH_LINK text should be replaced with the link Expensify/App#41110 so it would be $ Expensify/App#41110

DONE

@sobitneupane
Copy link
Contributor

Sorry for the delay. I will review the PR asap.

* `\b\_([^<>]*?)\_\b` doesn't work because it won't replace
* `_https://www.test.com_`
* Use [\s\S]* instead of .* to match newline
* Ignore <pre>, <code>, <a>, <mentin-user> tag contents first, so _blank is ignored due to it a property of <a>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skyweb331 Can you please only remove those comments that are irrelevant after the change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sobitneupane Removed the comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skyweb331 Sorry for the misunderstanding. I mean to say please keep older comments as well if they are still relevant.

@@ -177,7 +177,7 @@ export default class ExpensiMark {
{
name: 'reportMentions',

regex: /(?<![^ \n*~_])(#[\p{Ll}0-9-]{1,80})/gmiu,
regex: /(?<![^ \n*~_])(#[\p{Ll}0-9-]{1,80})/gimu,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sobitneupane This is done by my vscode prettier... seems like no meaningful change.

Copy link
Contributor

@sobitneupane sobitneupane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update @skyweb331

Changes look good and test well
Screenshot 2024-05-20 at 13 49 19

@thienlnam
Copy link
Contributor

Hmm, looks like we have some commits that are not signed - @skyweb331 could you fix them with steps from https://expensify.slack.com/archives/C01GTK53T8Q/p1711655905519379?thread_ts=1711571483.669109&cid=C01GTK53T8Q?

@skyweb331
Copy link
Contributor Author

@thienlnam I thought commit verification is only for NewDot. I fixed it. Thank you.

Copy link
Contributor

@thienlnam thienlnam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@thienlnam thienlnam merged commit 315f810 into Expensify:main May 29, 2024
6 checks passed
Copy link

🚀Published to npm in v2.0.6

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.

3 participants