From e53a545f046f5e6bd9f1e7f973530ca922a04002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Flore-Th=C3=A9bault?= Date: Sat, 20 May 2023 11:25:01 +0200 Subject: [PATCH] chore: also remove the PowerShell prompt (`> `) when copying shell-session content. (#2555) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: also remove the PoserShell prompt (`> `) when copying shell-session content. Signed-off-by: Fabrice Flore-Thébault * Update website/src/theme/CodeBlock/CopyButton/index.js Signed-off-by: Fabrice Flore-Thébault --------- Signed-off-by: Fabrice Flore-Thébault --- website/src/theme/CodeBlock/CopyButton/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/src/theme/CodeBlock/CopyButton/index.js b/website/src/theme/CodeBlock/CopyButton/index.js index 3979ae3bafd..2e1a8a58adb 100644 --- a/website/src/theme/CodeBlock/CopyButton/index.js +++ b/website/src/theme/CodeBlock/CopyButton/index.js @@ -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); }