From eeb3b239dcb0e65f655f479fe2718438fc4b21a3 Mon Sep 17 00:00:00 2001 From: Julien Richard Date: Thu, 15 Apr 2021 21:47:50 +0200 Subject: [PATCH] Updated highlight.js example (#2568) * Update highlight.js version in example * Fix for instant navigation --- docs/reference/code-blocks.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/reference/code-blocks.md b/docs/reference/code-blocks.md index d1b67a02c..d622b2c6e 100644 --- a/docs/reference/code-blocks.md +++ b/docs/reference/code-blocks.md @@ -56,17 +56,19 @@ configuring syntax highlighting of code blocks: === "docs/javascripts/config.js" ``` js - hljs.initHighlighting() + document$.subscribe(() => { + hljs.highlightAll() + }) ``` === "mkdocs.yml" ``` yaml extra_javascript: - - https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js + - https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/highlight.min.js - javascripts/config.js extra_css: - - https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/default.min.css + - https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/default.min.css ``` Note that Highlight.js has no affiliation with the Highlight extension.