-
Notifications
You must be signed in to change notification settings - Fork 146
Update codeblock parsing rule #865
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
Update codeblock parsing rule #865
Conversation
jmusial
left a comment
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.
LGTM
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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.
Yeah, I think it applies to all other markdown tests. They are heavily mixed, so reorganizing them into describe sections would be beneficial
|
@jjcoffee Yeah, it should be safe to bump it inside E/App now. It will just change codeblock parsing rules :D |
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