Skip to content

Commit

Permalink
Merge pull request #1613 from FWYongxing/master
Browse files Browse the repository at this point in the history
Don't highlight `inline code` blocks in headers with output.html. playpen(playgroud).editable=true
  • Loading branch information
ehuss authored Jul 26, 2021
2 parents 2ccfaad + 49ef7b6 commit 97b3806
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 97b3806

Please sign in to comment.