We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b38f6a6 commit fcafd20Copy full SHA for fcafd20
devdocs-macos/user-scripts/page-search.js
@@ -77,6 +77,9 @@
77
78
node.innerHTML = '';
79
node.appendChild(fragment);
80
+ // FIXME
81
+ // Not sure sure why, but this is also returning nodes not
82
+ // attached to the document tree.
83
return Array.from(node.querySelectorAll('mark'));
84
};
85
@@ -182,7 +185,11 @@
182
185
class SearchState {
183
186
constructor({ term, marks }) {
184
187
this.term = term;
- this.marks = marks;
188
189
+ // For some reason, we are getting nodes that are not attached
190
+ // to the document tree. Work around this issue by filtering out
191
+ // nodes not attached to the tree.
192
+ this.marks = marks.filter(mark => document.body.contains(mark));
193
}
194
195
isCurrentTerm(term) {
0 commit comments