-
Notifications
You must be signed in to change notification settings - Fork 136
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
Pass extra data (fe. accountIDs) to HTMLToMarkdown method & add possibility to disable certain rules #686
Pass extra data (fe. accountIDs) to HTMLToMarkdown method & add possibility to disable certain rules #686
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
CC. @rlinoz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one question
lib/ExpensiMark.d.ts
Outdated
declare type Name = | ||
| 'codeFence' | ||
| 'inlineCodeBlock' | ||
| 'email' | ||
| 'link' | ||
| 'hereMentions' | ||
| 'roomMentions' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused, why we need the roomMentions
here if we renamed it o reportMentions
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Missed that while implementing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Merging to unblock other issues |
This PR consists of two different changes
htmlToMarkdown
method now has additional, optional argumentextras
this argument adds the possibility to pass extra data which can be used in replacement function. For now is used to pass accountID to name and reportID to name mapsreplace
method has additional object keydisabledRules
. Every rule name from this array will be skipped in parsing.Fixed Issues
$ Expensify/App#40480
Expensify/App#39550
Tests
What unit/integration tests cover your change? What autoQA tests cover your change?
The changes, which this PR introduces, allows to more precisely interact with parser. To be precise, now we will be able to pass application state to the parser itself. We wrote couple of unit tests which mocks passing
extras
object with account ID and reportID maps to ensure that parsing shortened room and user mentions tags works as intended.What tests did you perform that validates your changed worked?
We also tested our changes inside E/App. It's not yet supported on main branch, but all changes worked as intended
QA
These changes cannot be tested on E/App yet. Only follow-up PR will be using these changes
As we were touching methods responsible for both HTML –> markdown and markdown -> HTML we should look for regressions in every rule and parsing.