Skip to content

Commit

Permalink
Don't highlight inline code blocks in headers with output.html.play…
Browse files Browse the repository at this point in the history
…pen(playgroud).editable=true
  • Loading branch information
clement2026 committed Jul 26, 2021
1 parent 27faa54 commit 49ef7b6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/theme/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,13 @@ function playground_text(playground) {
if (window.ace) {
// language-rust class needs to be removed for editable
// blocks or highlightjs will capture events
Array
.from(document.querySelectorAll('code.editable'))
code_nodes
.filter(function (node) {return node.classList.contains("editable"); })
.forEach(function (block) { block.classList.remove('language-rust'); });

Array
.from(document.querySelectorAll('code:not(.editable)'))
code_nodes
.filter(function (node) {return !node.classList.contains("editable"); })
.forEach(function (block) { hljs.highlightBlock(block); });
} else {
code_nodes.forEach(function (block) { hljs.highlightBlock(block); });
Expand Down

0 comments on commit 49ef7b6

Please sign in to comment.