diff --git a/_sass/spec/base.scss b/_sass/spec/base.scss index 9e23b3c1..e0628563 100644 --- a/_sass/spec/base.scss +++ b/_sass/spec/base.scss @@ -741,6 +741,11 @@ div.primer-spec-callout { &:hover .primer-spec-zeroclipboard-container { opacity: 1; } + + // Prevent the console prompts from being selectable. + span.primer-spec-code-block-non-selectable { + user-select: none; + } } .tooltipped:hover, diff --git a/src_js/components/main_content/useEnhancedCodeBlocks.tsx b/src_js/components/main_content/useEnhancedCodeBlocks.tsx index 074d90fc..c30aea9f 100644 --- a/src_js/components/main_content/useEnhancedCodeBlocks.tsx +++ b/src_js/components/main_content/useEnhancedCodeBlocks.tsx @@ -370,7 +370,11 @@ function createCodeBlockLine(options: { const childrenToIncludeInSelection = children.slice(i); // (3) Wrap remaining children in a new with id=LC_ID. codeLine.innerHTML = ''; - codeLine.appendChild({childrenToExcludeFromSelection}); + codeLine.appendChild( + + {childrenToExcludeFromSelection} + , + ); codeLine.appendChild( {childrenToIncludeInSelection}, );