Merge pull request #10364 from AA-Turner/fix-terms-check

Fix `highlightSearchWords`'s terms check in `doctools.js`
This commit is contained in:
Takeshi KOMIYA 2022-04-24 15:51:49 +09:00 committed by GitHub
commit 1660b3ebc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,7 +132,7 @@ const Documentation = {
highlightSearchWords: () => {
const highlight =
new URLSearchParams(window.location.search).get("highlight") || "";
const terms = highlight.toLowerCase().split(/\s+/);
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
if (terms.length === 0) return; // nothing to do
// There should never be more than one element matching "div.body"