File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -304,15 +304,16 @@ async function highlightElement(
304304 console . error ( `Prism doesn't support this language: ${ importLanguage } ` ) ;
305305 }
306306 }
307-
307+ // Highlight the code block and conditionally enable toolbar plugins (including copy button)
308308 if ( codeElement ) {
309+ // First highlight the element
309310 Prism . highlightElement ( codeElement ) ;
310-
311+ // Then activate toolbar plugins on the parent container if copy button is not hidden
311312 if ( ! hideCopyButton ) {
312313 const container = codeElement . closest ( `.${ styles . Container } ` ) ;
313314 if ( container ) {
314315 Prism . highlightAllUnder ( container ) ;
315-
316+ // If the code block is a diff, add diff markers and override the copy button
316317 if ( isDiff ) {
317318 addDiffMarkers ( container , codeElement ) ;
318319 overrideDiffCopyButton ( container , codeElement ) ;
You can’t perform that action at this time.
0 commit comments