diff --git a/components/layout/CodeHighlight.js b/components/layout/CodeHighlight.js index fe22b5fd7..966bac481 100644 --- a/components/layout/CodeHighlight.js +++ b/components/layout/CodeHighlight.js @@ -9,7 +9,10 @@ const CodeHighlight = { else if (modifiers.css || value === 'css') el.className = 'language-css'; else el.className = 'language-markup'; - DomHandler.isClient() && window.Prism.highlightElement(el.children[0]); + if (DomHandler.isClient()) { + window.Prism.highlightElement(el.children[0]); + el.children[0].parentElement.setAttribute('tabindex', '-1'); + } } };