patternfly-react icon indicating copy to clipboard operation
patternfly-react copied to clipboard

Bug - [CodeBlock ] - [eats up quotation marks and symbols between them]

Open Fewwy opened this issue 11 months ago • 0 comments

Describe the problem CodeBlock component Backend developers requested to add this piece of code exactly how it looks to the UI. Component removes "\t" and "\n" inside the curly braces

<CodeBlock>
                  {`oc get namespace -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.metadata.uid}{"\n"}{end}'`}
                  <Divider />
                  {`oc -n <namespace> get <resourceKind> -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.metadata.uid}{"\n"}{end}'`}
                </CodeBlock>

CodeBlockCode component do not work as well <CodeBlock> <CodeBlockCode> {oc get namespace -o jsonpath='{range .items[]}{.metadata.name}{"\t"}{.metadata.uid}{"\n"}{end}'} {oc -n get <resourceKind> -o jsonpath='{range .items[]}{.metadata.name}{"\t"}{.metadata.uid}{"\n"}{end}'} </CodeBlockCode> </CodeBlock>

How do you reproduce the problem? Copy the piece of code I provided and try it.

Expected behavior Code block shouldn't remove a piece of code

Is this issue blocking you? Yes

Screenshots If applicable, add screenshots to help explain the issue. Example of the issue image

With CodeBlockCode component image

What is your environment?

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

What is your product and what release date are you targeting?

Any other information?

Fewwy avatar Mar 04 '24 14:03 Fewwy