Skip to content

Commit

Permalink
Skip .mermaid in highlightSearchWords
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Oct 28, 2022
1 parent 54b4230 commit d416b34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dist/search.js
Expand Up @@ -215,7 +215,7 @@ class LocalSearch {
const walk = document.createTreeWalker(body, NodeFilter.SHOW_TEXT, null);
const allNodes = [];
while (walk.nextNode()) {
if (!walk.currentNode.parentNode.matches('button, select, textarea')) allNodes.push(walk.currentNode);
if (!walk.currentNode.parentNode.matches('button, select, textarea, .mermaid')) allNodes.push(walk.currentNode);
}
allNodes.forEach(node => {
const [indexOfNode] = this.getIndexByWord(keywords, node.nodeValue);
Expand Down

0 comments on commit d416b34

Please sign in to comment.