Search and replace, as provided by the code Editor, just doesn't work when using it at "Page:" namespace. It does find the text, but selects (and replaces) text located about 50 characters to the right.
It is incredibly useful as you might have some easily fixable OCR error spanning multiple pages, and that tool is simple and incorporated by default. Most wikisourcians use other tools, such as TemplateScript, that includes search and replace functionality, but the fact that the default tool doesn't work (and causes havoc if used carelessly) is worrying.
STEPS TO REPRODUCE
- Go to any "Page:", say for example [ https://es.wikisource.org/w/index.php?title=P%C3%A1gina:Viajes_de_Fray_Francisco_Men%C3%A9ndez_a_Nahuelhuapi.pdf/232&action=edit ]
- Use the default search and replace tool (magnifying glass icon, top right) to search for text that you know it is there, for example "Tellez"
- Instead of "Tellez", the editor finds "añas, " (or some other text) (located 72 chars to the right)
- I have tried this using both Chrome and Microsoft Edge, with the same results.
- I have tried this in several Wikisources, with the same results.
- I have tried this logged in and as a guest, with some changes: in the example given, it selects instead text located 39 chars to the right
- I have tried searching in other pages of the same work, and always selects text located the same number of characters away (is consistent within the work)
- Line breaks are probably counted as 2 characters (not fully tested)
- I have tried searching in other works, and each work has his own "number", different for logged in and guest, (for example 54 and 23 for [ https://es.wikisource.org/w/index.php?title=P%C3%A1gina:Mensaje_presidencial_del_21_de_mayo_de_2010.pdf/23&action=edit ]