Update MarkdownRenderer and add test files #56
Merged
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 pull request introduces enhancements to the
CodeViewandMarkdownRenderercomponents, focusing on adding support for customizable copy button properties and improving the test coverage for these components. The changes ensure that the copy button functionality is more flexible and thoroughly tested.Enhancements to
CodeViewComponent:copyButtonPropsprop to theCodeViewPropsinterface, allowing customization of the copy button's attributes. (src/CodeView.tsx, src/CodeView.tsxR12-R14)CodeViewcomponent to pass thecopyButtonPropsto theMarkdownRendererwhen rendering HTML fragments. (src/CodeView.tsx, src/CodeView.tsxL60-R67)Enhancements to
MarkdownRendererComponent:appendCopyButtonfunction to accept and apply custom button properties (copyButtonProps) when creating the copy button. (src/MarkdownRenderer.tsx, src/MarkdownRenderer.tsxR40-R59)MarkdownRendererPropsinterface to include thecopyButtonPropsproperty. (src/MarkdownRenderer.tsx, src/MarkdownRenderer.tsxR10-R25)Testing Improvements:
CodeViewcomponent, including tests for rendering, passingcopyButtonProps, and ensuring thesourceCodeis passed correctly. (__tests__/CodeView-test.js, tests/CodeView-test.jsR1-R53)MarkdownRenderercomponent, covering rendering, handling multiple code blocks, and verifying the copy button's functionality and customization. (__tests__/MarkdownRenderer-test.js, tests/MarkdownRenderer-test.jsR1-R152)