|
![]() |
|
Thread Tools | Search this Thread |
![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 834
Karma: 2912460
Join Date: Apr 2009
Device: Kobo Forma
|
Searched for words inside a book. "This text is hidden and cannot be displayed"
Hi Kovid developer,
I searched for some text in a book and it found it. But it says "This text is hidden and cannot be displayed". Please see screenshot. Using Calibre 6.20. |
![]() |
![]() |
![]() |
#2 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,191
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
What does the CSS and styling around that search item look like? Considering the repeated bits of text such as 175, QUEEN MARGARET, & EDWARD, which are unlikely to be visible.
For what it's worth, I downloaded the ePub3 version from Gutenberg and it did not have any issues with searching. Where did you obtain your copy? I did find a PDF copy that had those numbers. Last edited by DNSB; 06-16-2023 at 10:05 PM. |
![]() |
![]() |
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
When searching for a term that is not visible on the viewer, you get that message. The numbers are probably hidden either by CSS (display: none) or using the HTML 'hidden' property. But that should not affect searching for the term near it, hence the bug. Test case: Code:
<p>Ordinary text being displayed.</p> <p style="display:none">Hidden text</p> |
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That's unavoidable given how search works it has to search for context as well to find the correct match.
|
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Well, can't the viewer highlight just the searched term if it is visible text? I mean, calibre does find and display the searched term (and context). Also, the viewer already opens the right chapter (html file).
|
![]() |
![]() |
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There are technical reasons why this is not possible, if you know a way to make it possible feel free to submit a patch. Relevant code is in viewer/search.py and read_book/find.pyj
EDIT: You can have it show matches with hidden context, by simply commenting out 30-32 in find.pyj but doing this will mean that when searching for hidden text, the result wiil be displayed but clicking on it wont highlight anything. Last edited by kovidgoyal; 06-17-2023 at 11:24 PM. |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
On second thoughts, this should improve the situation, making detection of hidden text more robust.
https://github.com/kovidgoyal/calibr...5cd22366c972a4 |
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Thanks, Kovid!
Searching for a term next to the hidden text now works perfectly (jumps to it and highlights). About searching for hidden text, now it doesn't show the alert, as before. I don't know if it's because I'm running from source. |
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
It will now show the alert when you click on the result witht he hidden text.
|
![]() |
![]() |
![]() |
#10 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
|
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
post a book and a search for which it happens
|
![]() |
![]() |
![]() |
#12 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
I added this code to the original Project Gutenberg's book:
Code:
..as he fled with more than mortal speed.</p> <p style="display:none">Example of hidden text</p> <p>I pursued him; and for many months this has been my task... Now, if I search for 'hidden text', it shows the result without the alert; clicking on it doesn't show the alert either. |
![]() |
![]() |
![]() |
#13 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Works for me, see attached.
|
![]() |
![]() |
![]() |
#14 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Ah but it doesnt work when searching for multiple hidden words.
|
![]() |
![]() |
![]() |
#15 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pressing "Restore Defaults" under "Book Details" wipes all "Look & Feel" settings. | MarjaE | Library Management | 1 | 03-30-2021 11:46 AM |
E-book viewer: "Lookup words" window | iG0R | Calibre | 26 | 04-18-2020 09:20 PM |
Are there "flows" for Look Inside The Book? | Notjohn | Kindle Formats | 7 | 07-06-2017 03:41 PM |
"Conversion of WMF images is not supported" message inside converted book | FF2 | Conversion | 8 | 04-11-2011 11:08 AM |
Inside "Edit Metadata" - hotkey for Next Book ? | pchrist7 | Library Management | 11 | 03-19-2011 02:40 AM |