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

Prevent parsing backticks if are only content of inline code block #628

Merged
merged 2 commits into from
Dec 27, 2023

Conversation

robertKozik
Copy link
Contributor

This PR modifies the replacement function for inline code blocks. Now, the function checks if the content consists only of backtick symbols. If yes, the unmodified match string is returned; otherwise, the behavior should remain unchanged.

I opted to implement this check within the replacement function rather than inside the already established regex. This decision was made because incorporating this check inside the regex was challenging without introducing regressions (especially with the ``` ``` string). Moreover, splitting it should be beneficial for code readability.

Fixed Issues

$ Expensify/App#31493

Tests

  1. What unit/integration tests cover your change? What autoQA tests cover your change?
    two unit test are added to the test suite to cover prime examples of this issue: ``` and `````` which should ensure that no matter how long is the sequence of backticks, as long as they are only symbols inside the content it will not parse
  2. What tests did you perform that validates your changed worked?
    Run all unit tests and cross-check inside newDot

QA

  1. What does QA need to do to validate your changes?
    Testing is quite straight forward. Inside newDot chat any sequence of backticks (wihtout any other char) shouldn't be parsed (fe. ``````` or ```````````)
  2. What areas to they need to test for regressions?
    Since this PR only modifies the ExpensiMark part responsible for parsing inline code blocks, any regressions might occur while users are typing such markdown. To ensure that no regressions are introduced, besides unit tests, existing regression tests involving inline code blocks can be rerun.

@robertKozik robertKozik requested a review from a team as a code owner December 27, 2023 14:53
@melvin-bot melvin-bot bot requested review from tgolen and removed request for a team December 27, 2023 14:54
@tgolen tgolen merged commit 6df214a into Expensify:main Dec 27, 2023
3 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.

2 participants