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

Data html attributes #626

Merged
merged 4 commits into from
Jan 9, 2024

Conversation

robertKozik
Copy link
Contributor

@robertKozik robertKozik commented Dec 20, 2023

This PR extends usage of the shouldKeepWhitespace flag which was created for Live Markdown Preview.

  • changes the name of the flag to shouldKeepRawInput to indicate extended usability of the flag
  • based on this flag new replacement method can be called if implemented for every rule.
  • new replacement method should return similar HTML structure as normal replacement but enrich the tag with unmodified values of input which is necessary for Live Markdown Preview
  • unmodified values are exposed by rawInputReplacement functions as new HTML attributes:
    • data-code-raw - contains escaped version of code block, new lines/whitespaces included
    • data-raw-href - contains unmodified version of the link/email
    • data-link-variant - contains information whether the link was typed as labeled link or as auto link
    • link labels are passed unmodified
Screen.Recording.2023-12-20.at.21.12.04.mov

Fixed Issues

$ Expensify/App#33026
$ Expensify/App#31181

Tests

  1. What unit/integration tests cover your change? What autoQA tests cover your change?
    New unit tests were implemented in order to test the changes. To test it by yourself you will need example app.

  2. What tests did you perform that validates your changed worked?

QA

  1. What does QA need to do to validate your changes?
    Same as tests
  2. What areas to they need to test for regressions?
    This PR shouldn't introduce any changes within parsing the messages while sending. We can ensure it by checking how links/mails are parsed while being send within the expensify app

@robertKozik robertKozik requested a review from a team as a code owner December 20, 2023 20:46
Copy link

github-actions bot commented Dec 20, 2023

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

@melvin-bot melvin-bot bot requested review from hayata-suenaga and removed request for a team December 20, 2023 20:46
@robertKozik
Copy link
Contributor Author

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

@hayata-suenaga
Copy link
Contributor

A C+ will review this RP soon. I pinged them

@situchan
Copy link
Contributor

New unit tests were implemented in order to test the changes. To test it by yourself you will need example app

@robertKozik I don't have access to this repo

https://github.com/tomekzaw/react-native-markdown-text-input/tree/remove-newline-char-codeblock

@robertKozik
Copy link
Contributor Author

Hi @situchan, unfortunately, afaik I cannot grant you access to the repo. I believe code review and unit tests should be sufficient in this particular case, along with checking for any regression in the Expensify app. These changes shouldn't impact the normal messaging flow inside new-dot.
cc. @tomekzaw

@robertKozik
Copy link
Contributor Author

Hey @situchan how is review going?

@situchan
Copy link
Contributor

Code LGTM. I will complete test by tomorrow

@robertKozik
Copy link
Contributor Author

How is the progress @situchan ?

Copy link
Contributor

@situchan situchan left a comment

Choose a reason for hiding this comment

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

  • code review ✅
  • unit tests ✅
  • checking for any regression in the Expensify app. These changes shouldn't impact the normal messaging flow inside new-dot ✅
  • test live markdown in new RN app ❌

@robertKozik
Copy link
Contributor Author

@hayata-suenaga Hi! Can we proceed further with merge after @situchan review?

Copy link
Contributor

@hayata-suenaga hayata-suenaga left a comment

Choose a reason for hiding this comment

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

code looks good to me, too

@hayata-suenaga
Copy link
Contributor

@situchan just to double confirm, are we good to merge this?

@situchan
Copy link
Contributor

situchan commented Jan 9, 2024

@situchan just to double confirm, are we good to merge this?

yes. This repo doesn't require big checklist like app repo

@hayata-suenaga hayata-suenaga merged commit 23c34c6 into Expensify:main Jan 9, 2024
5 checks passed
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