chore: also remove the PowerShell prompt (> ) when copying shell-session content. (#2555)

* chore: also remove the PoserShell prompt (`> `) when copying
shell-session content.

Signed-off-by: Fabrice Flore-Thébault <ffloreth@redhat.com>

* Update website/src/theme/CodeBlock/CopyButton/index.js

Signed-off-by: Fabrice Flore-Thébault <ffloreth@redhat.com>

---------

Signed-off-by: Fabrice Flore-Thébault <ffloreth@redhat.com>
This commit is contained in:
Fabrice Flore-Thébault 2023-05-20 11:25:01 +02:00 committed by GitHub
parent 0d84e45417
commit e53a545f04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,9 @@ export default function CopyButtonWrapper(props) {
const updatedProps = { ...props };
if (
updatedProps?.code?.length > 2 &&
(updatedProps.code.substring(0, 2) === '$ ' || updatedProps.code.substring(0, 2) === '# ')
(updatedProps.code.substring(0, 2) === '$ ' ||
updatedProps.code.substring(0, 2) === '# ' ||
updatedProps.code.substring(0, 2) === '> ')
) {
updatedProps.code = updatedProps.code.substring(2);
}