Edit Book Find feature does not find consistently.

Bug #1868847 reported by Jonas Fox on 2020-03-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Undecided
Unassigned

Bug Description

When using the Edit Book "Find" Feature, many times it will not find a phrase that is contained in the document. The feature sometimes finds fine but the longer the phrase, the more of a chance it won't find a match.

For context, I'm copying/pasting from Word into the find field. When this error occurs I can usually remove words from the find field to eventually get it to find a portion of the search but this doesn't always work. This is being done from Normal Mode. Perhaps there are hidden symbols that are or symbol changes causing the problem.

Maybe a closest match feature would fix this? Or maybe I'm supposed to be using the regex mode? Is so, I couldn't find any documentation regarding it.

This is in Calibre version 4.12.0 running on Windows 10.

Jonas Fox (farmerjonas) wrote :

I believe I know the problem here. Line breaks or carrage returns in the htm document (that don't show up in the preview, just the editor window) count against the exact search phrase.

Why are their line breaks in the document? It imported that way from Word.

Perhaps there's a way for search to ignore these added spaces from being seen by the search feature?

Jonas Fox (farmerjonas) wrote :

I also found you can work around these carriage returns by searching in the preview search section which is to the right of find. It won't let you do find/replace the same but it should help for finding individual items.

If you want to match line breaks, you need to use regex mode. There is
an entire section in the User Manual on how to use regexes. https://manual.calibre-ebook.com/regexp.html

 status invalid

Changed in calibre:
status: New → Invalid
Kovid Goyal (kovid) wrote :

And for the next release I will have normal mode find/replace treat
spaces specially, so that they match multiple spaces and line breaks.

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: Invalid → Fix Released
Jon Wolf (jswolf) wrote :

No, it's not fixed. It's actually now broken the normal search/replace. Please remove this feature as it doesn't work.

If I have

 a
 b
 c

And I select the b line including the line ending and do a replace all, I end up removing all of the letter b. So yes it is broken. Can you please remove this new broken feature?

Jon Wolf (jswolf) wrote :

And for the next release I will have normal mode find/replace treat
spaces specially, so that they match multiple spaces and line breaks.

This has seriously broking search/replace. Please remove this. The person who wants this should be using regex and normal should be the way it's always been.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers