Update codeblock parsing rule#865
Merged
chiragsalian merged 3 commits intoExpensify:mainfrom Jul 8, 2025
Merged
Conversation
This was referenced Jul 4, 2025
jmusial
approved these changes
Jul 8, 2025
| codeFenceExample = '~Test1 ```\ncode\n``` Test2~'; | ||
| expect(parser.replace(codeFenceExample)).toBe('~Test1 <pre>code<br /></pre> Test2~'); | ||
| expect(parser.replace(codeFenceExample, {shouldKeepRawInput: true})).toBe('~Test1 <pre>\ncode\n</pre> Test2~'); | ||
| codeFenceExample = '~Test1\n```\ncode\n```\nTest2~'; |
There was a problem hiding this comment.
NAB, or part of this issue, but IMO the tests would benefit from making
Test code fencing with ExpensiMark syntax outside
a describe and having test cases as test with separate descriptions
Contributor
Author
There was a problem hiding this comment.
Yeah, I think it applies to all other markdown tests. They are heavily mixed, so reorganizing them into describe sections would be beneficial
chiragsalian
approved these changes
Jul 8, 2025
Contributor
Contributor
51 tasks
Contributor
Author
|
@jjcoffee Yeah, it should be safe to bump it inside E/App now. It will just change codeblock parsing rules :D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the codeblock parsing rule so it:
We introduce this change to make parsing rules when typing markdown text inside the Live Markdown input more similar to the result that the user can see after sending the message in E/App. The above changes allow us to create a more intuitive and logical way to use code blocks when typing. Simplifying the parsing rules will also protect us from many complex and hard styling possibilities in the future.
This PR is part of code fence and inline code block refactor in the
react-native-live-markdownlibrary - PRFixed Issues
Expensify/App#39518
Tests
QA
Verify new parsing rules as specified in the Test section