Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 10-07-2024, 05:04 PM   #31
foosion
Evangelist
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 450
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
Quote:
Originally Posted by Turtle91 View Post
That’s what I do most of the time (regex)… BUT … you need to be very careful of nested tags especially if you are searching for <span>s because that regex will pickup the first end tag not necessarily the correct one.

As Diap mentioned, his plugin actually parses the html to avoid that issue.
I'm not sure which post you're responding to. Assume it's recent:

I can't recall ever seeing a nested h# tag and Jon's example wasn't nested.

I'm not sure it's even possible to do nested properly with standard regex. I started a post asking about that and so far I've gotten the expected lack of response.

Anyway, agreed.
foosion is offline   Reply With Quote
Old 10-07-2024, 05:05 PM   #32
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,549
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I'm not certain if the calibre flavour of DiapDealer's tool will handle regex but the Sigil version does. For a <tag>blah blah blah</tag> I will use regex but where nested tags come into play, I will go with TagMechanic. I remember way back (2012, Sigil 0.5.3???) when I looked at the dog's breakfast that I created using a regex search/replace covering nested divs and exited without saving.
DNSB is offline   Reply With Quote
Old 10-07-2024, 05:07 PM   #33
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,436
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Turtle91 View Post
That’s what I do most of the time (regex)… BUT … you need to be very careful of nested tags especially if you are searching for <span>s because that regex will pickup the first end tag not necessarily the correct one.

As Diap mentioned, his plugin actually parses the html to avoid that issue.
I agree. I use Diap's plugin for divs and spans because it works better then risking regex.
JSWolf is offline   Reply With Quote
Old 10-07-2024, 05:09 PM   #34
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,436
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by DNSB View Post
I'm not certain if the calibre flavour of DiapDealer's tool will handle regex but the Sigil version does. For a <tag>blah blah blah</tag> I will use regex but where nested tags come into play, I will go with TagMechanic. I remember way back (2012, Sigil 0.5.3???) when I looked at the dog's breakfast that I created using a regex search/replace covering nested divs and exited without saving.
The calibre version of Diaps Editing Toolbag does allow regex for the search.
JSWolf is offline   Reply With Quote
Old 10-07-2024, 07:09 PM   #35
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Terisa de morgan View Post
In any case, that change would be appreciated (and I've checked and I've not found the way to do it in the settings).
You can't, I checked. It shouldn't take too much to make it work by editing the plugin's preference file rather than needing to edit the plugin's code. That way, the changes would survive a plugin upgrade. I'll see what I can do.

Last edited by DiapDealer; 10-07-2024 at 07:20 PM.
DiapDealer is online now   Reply With Quote
Old 10-08-2024, 02:19 AM   #36
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,393
Karma: 12408443
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by DiapDealer View Post
You can't, I checked. It shouldn't take too much to make it work by editing the plugin's preference file rather than needing to edit the plugin's code. That way, the changes would survive a plugin upgrade. I'll see what I can do.
Thank you very much! I don't do a lot of changes like that, but I use the plugin A LOT.
Terisa de morgan is online now   Reply With Quote
Old 10-08-2024, 01:04 PM   #37
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Terisa de morgan View Post
Thank you very much! I don't do a lot of changes like that, but I use the plugin A LOT.
You should be able to add (or remove) tags like you do html attributes (in the settings) with this beta version. Let me know what you think.

Were you the one who provided the Spanish translation for this plugin? If so, I've got a couple of new strings that will need translating (after we make sure this will work properly).

EDIT: attachment removed

Last edited by DiapDealer; 10-08-2024 at 09:14 PM.
DiapDealer is online now   Reply With Quote
Old 10-08-2024, 01:12 PM   #38
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,393
Karma: 12408443
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by DiapDealer View Post
You should be able to add (or remove) tags like you do html attributes (in the settings) with this beta version. Let me know what you think.

Were you the one who provided the Spanish translation for this plugin? If so, I've got a couple of new strings that will need translating (after we make sure this will work properly).
I'll test it today and I think I provided the translation, yes. I'll take care of it when it's ready.
Terisa de morgan is online now   Reply With Quote
Old 10-08-2024, 04:54 PM   #39
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,393
Karma: 12408443
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by DiapDealer View Post
You should be able to add (or remove) tags like you do html attributes (in the settings) with this beta version. Let me know what you think.

Were you the one who provided the Spanish translation for this plugin? If so, I've got a couple of new strings that will need translating (after we make sure this will work properly).
I've added first h1,h2,h3,h4 and later h5,h6. h1,h2,h3,h4 were already in the json configuration file so, after adding the tag and opening the configuration, it was working fine and there was configuration for changing those tags. After adding h5 and h6, opening the configuration dialog show an error:
Code:
KeyError: 'h5_changes'
So, it looks like adding the tag means that the plugin is expecting later to find a configuration entry but it's not added.
Terisa de morgan is online now   Reply With Quote
Old 10-08-2024, 05:33 PM   #40
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,436
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Terisa de morgan View Post
I've added first h1,h2,h3,h4 and later h5,h6. h1,h2,h3,h4 were already in the json configuration file so, after adding the tag and opening the configuration, it was working fine and there was configuration for changing those tags. After adding h5 and h6, opening the configuration dialog show an error:
Code:
KeyError: 'h5_changes'
So, it looks like adding the tag means that the plugin is expecting later to find a configuration entry but it's not added.
Same error as well.
JSWolf is offline   Reply With Quote
Old 10-08-2024, 05:43 PM   #41
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'll check it out. Thanks for the input.
DiapDealer is online now   Reply With Quote
Old 10-08-2024, 08:47 PM   #42
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Try this one on for size.

EDIT: removed attachment as the new version is available in the plugin's own thread: https://www.mobileread.com/forums/sh...d.php?t=251365

Last edited by DiapDealer; 10-10-2024 at 10:55 AM.
DiapDealer is online now   Reply With Quote
Old 10-09-2024, 02:21 AM   #43
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,393
Karma: 12408443
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
It works now, if I add a tag, configuration entry is added, and if I remove it, configuration entry is removed (at least from the dialog, I've not checked the json file). And thank you very much again for the change.

Last edited by Terisa de morgan; 10-09-2024 at 07:49 AM.
Terisa de morgan is online now   Reply With Quote
Old 10-09-2024, 06:33 AM   #44
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
The configuration entry for a removed tag will stay in the json. So if the tag is ever added back, it will already be present, That is by design (for now). Thanks for testing. I'm going to move any further beta-testing stuff to the plugin thread. I've hijacked this one long enough.
DiapDealer is online now   Reply With Quote
Old 10-09-2024, 08:21 AM   #45
foosion
Evangelist
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 450
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
Quote:
Originally Posted by DiapDealer View Post
I've hijacked this one long enough.
As the OP of this thread, I'm happy to inspire such a useful hijacking.
foosion is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
It's Complicated drjenkins Deals and Resources (No Self-Promotion or Affiliate Links) 13 03-06-2014 01:23 AM
I'm sure this would be complicated, but is this possible? Dullahir Calibre 5 06-03-2013 06:04 AM
Now Things Get Complicated Kris777 News 21 04-17-2010 04:25 AM
UK User - is it really this complicated?! twisticles Sony Reader 30 09-22-2008 11:46 PM


All times are GMT -4. The time now is 07:37 AM.


MobileRead.com is a privately owned, operated and funded community.