ueokande / vimmatic

A browser extension to enable Vim-like keymaps on the browsers!!
https://ueokande.github.io/vimmatic/
MIT License
181 stars 7 forks source link

Search doesn't ignore newlines #461

Open physixcat opened 1 month ago

physixcat commented 1 month ago

The issue is already reported or known issue?

Current behavior

When visiting this site , I noticed that using / to search for the string "fix your" comes up with zero results. Same problem if any string contains this substring (ie "should fix your"). However, if you search for "should fix" or "your program", those turn up.

I then looked at the source code for the page and noticed the problem: there are newlines in the html file here. "fix" happens to be at the end of a line, and "your" at the beginning of the next. That's why the search fails, because it doesn't ignore new lines. The same problem occurs when trying to search for "my views" (they are on separate lines in the source)

Expected behavior

Searching "fix your" or a string including it and the surrounding words should return a successful result in a search

Steps to reproduce

  1. Open page https://www.kernel.org/doc/html/next/process/coding-style.html
  2. Press key /
  3. Type fix your, hit enter
  4. The extension says Pattern not found: fix your
  5. Press / and type should fix, hit enter
  6. Result is highlighted correctly
  7. Press / and type your program, hit enter
  8. Result is highlighted correctly

Environment