File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed
Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 33 span {
44 // Default color when no highlighting is used
55 color : $color-white ;
6+ display : inline-block ;
7+ line-height : 16px ;
8+ height : 16px ;
69 }
710
811 & :not (.code-tabs .highlight-wrapper ) {
2831 .copy-code-button {
2932 position : absolute ;
3033 z-index : 2 ;
31- right : 18 px ;
34+ right : 0 ;
3235 top : 0 ;
3336 font-size : 13px ;
3437 font-weight : 700 ;
6063 z-index : -1 ;
6164 opacity : .01 ;
6265 }
66+
67+ ::selection {
68+ background-color : $color-purple-extra-dark ;
69+ }
6370}
Original file line number Diff line number Diff line change 1515 .nav-tabs {
1616 position : unset ;
1717 width : unset ;
18- color : #0f0f0f ;
1918 background : $color-black ;
2019 list-style-type : none ;
2120 margin : 0 ;
3231 color : #717171 !important ;
3332 font-weight : bold ;
3433 display : block ;
35- padding : 1 rem ;
34+ padding : 12 px 16 px ;
3635 text-decoration : none ;
3736 border-bottom : none !important ;
3837
3938 & :hover {
4039 --show-active-line : 1 ;
4140 color : $color-white !important ;
41+ box-shadow : none !important ;
4242
4343 & ::after {
4444 width : 100% ;
7171 .code-tabs {
7272 margin : 1rem 0 ;
7373 }
74-
7574}
Original file line number Diff line number Diff line change 1- {{ $opts := merge .Options (dict "linenos" true "lineNumbersInTable" false ) }}
1+ {{ $opts := merge .Options (dict "linenos" "inline" ) }}
22{{ $result := transform.HighlightCodeBlock . $opts }}
33{{ $result.Wrapped }}
Original file line number Diff line number Diff line change 3434 }
3535
3636 async function copyCodeToClipboard ( button , highlightDiv ) {
37- const codeToCopy = highlightDiv . querySelector ( ":last-child > pre > code" ) . innerText ;
37+ let codeToCopy = ""
38+ // Copy multiple lines without line numbers by explicitly selecting the code from each line
39+ highlightDiv
40+ . querySelectorAll ( ":last-child > pre > code > span > span:last-child" )
41+ . forEach ( ( row ) => { codeToCopy += row . innerText ; } ) ;
3842 try {
3943 result = await navigator . permissions . query ( { name : "clipboard-write" } ) ;
4044 if ( result . state == "granted" || result . state == "prompt" ) {
You can’t perform that action at this time.
0 commit comments