Skip to content

Commit 6e181ff

Browse files
committed
fix: copy codeblocks for powershell
Handle PowerShell prompt char (>) and PS1 script syntax for env var assignments Signed-off-by: David Karlsson <[email protected]>
1 parent 685cb30 commit 6e181ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

layouts/_default/_markup/render-codeblock.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{{ end }}
55
<div class="group relative">
66
<button x-data="{ code: '{{encoding.Base64Encode .Inner}}', copying: false }"
7-
class="absolute right-3 top-3 z-20 text-gray-light-300 dark:text-gray-dark-600" title="Copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^\$\s*/gm, ''));
7+
class="absolute right-3 top-3 z-20 text-gray-light-300 dark:text-gray-dark-600" title="copy" @click="window.navigator.clipboard.writetext(atob(code).replaceall(/^[\$>]\s+/gm, ''));
88
copying = true;
99
setTimeout(() => copying = false, 2000);">
1010
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden">{{ partialCached "icon" "content_copy" "content_copy" }}</span>

0 commit comments

Comments
 (0)