Skip to content

Commit 97b3806

Browse files
authored
Merge pull request #1613 from FWYongxing/master
Don't highlight `inline code` blocks in headers with output.html. playpen(playgroud).editable=true
2 parents 2ccfaad + 49ef7b6 commit 97b3806

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/theme/book.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,13 @@ function playground_text(playground) {
162162
if (window.ace) {
163163
// language-rust class needs to be removed for editable
164164
// blocks or highlightjs will capture events
165-
Array
166-
.from(document.querySelectorAll('code.editable'))
165+
code_nodes
166+
.filter(function (node) {return node.classList.contains("editable"); })
167167
.forEach(function (block) { block.classList.remove('language-rust'); });
168168

169169
Array
170-
.from(document.querySelectorAll('code:not(.editable)'))
170+
code_nodes
171+
.filter(function (node) {return !node.classList.contains("editable"); })
171172
.forEach(function (block) { hljs.highlightBlock(block); });
172173
} else {
173174
code_nodes.forEach(function (block) { hljs.highlightBlock(block); });

0 commit comments

Comments
 (0)