patternfly / patternfly/patternfly-react
ClipboardCopy - custom wrapper component
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 862
- Forks
- 392
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 9
Description
ClipboardCopy uses a div element to wrap everything and style the element. When using the component in conjunction with a markdown viewer, this ends up generating invalid html if the ClipboardCopy is used to style inline <code> tags.
An example is this visualization which comes from a markdown content rendered using react-markdown, customized to use ClipboardCopy and CodeBlock components (for single-line and multi-line snippet of code respectively) to style the code tags (visible at the bottom of the screen):
which generates this warning:
This could be solved by either defaulting the ClipboardCopy to use a span element by default, or by providing a customization property for the wrapping element as done for other components in the library.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the ClipboardCopy component implementation and its tests, then inspect how its div wrapper behaves when used around inline code elements from a markdown viewer. Done means the component supports the requested wrapper behavior, either through a span default or a wrapper customization property, without generating invalid HTML.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100