Skip to content

Commit

Permalink
Fix case-sensitive search in the browser's findbox.
Browse files Browse the repository at this point in the history
This uses findAndReplaceDOMText(), which apparently looks for
case-sensitive matches, but the search text entered by the user is
*always* converted to lowercase. This means that mixed case search terms
just won't be found, which is bad. (E.g., try searching for "GEM" in the
toc to see this bug in action.)

Fixed by just removing the call to toLowerCase() on the search text,
case-sensitive searches now work as expected, problem solved.
  • Loading branch information
agraef committed Sep 19, 2020
1 parent 5f9e943 commit 558ca83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pd/nw/dialog_search.html
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@
} else {
window.findAndReplaceDOMText(console_text, {
//preset: "prose",
find: elem.value.toLowerCase(),
find: elem.value,
wrap: wrap_tag
});
// The searchAndReplace API is so bad you can't even know how
Expand Down

0 comments on commit 558ca83

Please sign in to comment.