MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Plugins (https://www.mobileread.com/forums/forumdisplay.php?f=268)
-   -   Plugin to ignore tags when searching? (https://www.mobileread.com/forums/showthread.php?t=298842)

Vanguard3000 06-06-2018 09:22 PM

Plugin to ignore tags when searching?
 
I'm wondering if anyone has made a modification to Sigil that allows a user to specify when doing a find/replace to ignore html/css tags and header information.

As an example, I recently had a book that often — and inconsistently-used a simple minus sign to separate a sentence instead of an em- or en-dash (as seen in my cleverly-hidden example earlier in this sentence). But the search was rather obnoxious as searching for the minus sign gave me a lot of false positives inside style tags (e.g. <p class="italic-and-bold">). Given that the minus sign was also frequently-used as in my use of the phrase "frequently-used", I had enough false positives to sift through as it was!

I've found a few examples of regexes that can be used to ignore these tags, such as Timur's examples here, but I'm a pretty lazy guy and was wondering if there were an easier way in the form of a Sigil plugin.

Ideally, what I'm imagining is an additional dropdown menu in the search/replace panel's "Mode" section, that would have the options to "Ignore Tags", "Only Search in Tags", and "Search Everywhere".

Does anything like this exist? Thanks for the help.

kovidgoyal 06-06-2018 09:45 PM

It exists in the calibre editor https://manual.calibre-ebook.com/edi...ring-html-tags

@mods Apologies if this is out of line in the Sigil forum, if so, please feel free to delete, but I figured that it might be helpful to the OP.

KevinH 06-06-2018 09:55 PM

I normally use regular expressions to restrict matches to being outside tags. This is relatively straight forward and will greatly diminish your false positives. I believe this was already discussed in the Sigil Regular Expression thread. Simple text search in BookView works as well although I hate to push BookView to anyone.

BetterRed 06-06-2018 10:16 PM

I use the spellchecker for this particular case, Show all words, Filter for -. It's available in Sigil and calibre editor spellcheckers, and in the calibre editor's Tools->Reports->Words tool.

BR

DiapDealer 06-06-2018 10:17 PM

Quote:

Originally Posted by kovidgoyal (Post 3702911)
It exists in the calibre editor https://manual.calibre-ebook.com/edi...ring-html-tags

@mods Apologies if this is out of line in the Sigil forum, if so, please feel free to delete, but I figured that it might be helpful to the OP.

No problem. I personally don't mind anyone pointing out the (dis)advantages of either editor for the benefit those asking the questions.

We've had a couple people in the past who liked to camp out and point out calibre equivalents for every single feature/assistance request that newcomers brought up in the Sigil forum. I freely admit that THAT tended to get on my nerves after a while.

But you're welcome to comment here any time, Kovid. :D

kovidgoyal 06-07-2018 03:36 AM

Quote:

Originally Posted by DiapDealer (Post 3702942)

But you're welcome to comment here any time, Kovid. :D

Cool, glad I didn't step on any toes :)


All times are GMT -4. The time now is 08:57 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.