06-06-2018, 08:22 PM | #1 |
Groupie
Posts: 152
Karma: 474196
Join Date: Jan 2011
Location: Ottawa
Device: Kobo Aura H2O
|
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. |
06-06-2018, 08:45 PM | #2 |
creator of calibre
Posts: 44,355
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
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. |
06-06-2018, 08:55 PM | #3 |
Sigil Developer
Posts: 8,099
Karma: 5450184
Join Date: Nov 2009
Device: many
|
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.
|
06-06-2018, 09:16 PM | #4 |
null operator (he/him)
Posts: 20,936
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
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 |
06-06-2018, 09:17 PM | #5 | |
Grand Sorcerer
Posts: 27,903
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
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. |
|
06-07-2018, 02:36 AM | #6 |
creator of calibre
Posts: 44,355
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
Tags |
plugin, regex, search, search & replace, sigil |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ignore tags when downloading metadata? | rockola | Library Management | 2 | 12-09-2017 10:11 AM |
Searching for entries with no tags | sasilk | Library Management | 3 | 09-02-2017 11:48 AM |
Searching between tags | mariaclaudia | Calibre | 4 | 05-10-2017 05:38 PM |
Searching Tags | MzPepper | Library Management | 4 | 03-29-2017 02:36 PM |
Searching tags to show tags I want even when it has a tag I do not | Jade Aislin | Library Management | 2 | 04-25-2012 01:01 PM |