|
|
#1 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 208
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
|
Quick simple way to remove <a> ids?
I have an EPUB that's scattered through with apparently random <a id>s, which wouldn't bother me except the marked text shows as underlined on my Kobo.
Is there some way to do a search and replace, or something similar, to get rid of them all at once? Obviously each ID is unique, so I can't think of any other way to get rid of them other than manually, one by one. Which is a literal pain, since my disabled hands can't handle that much clicking. Each ID number/string of letters appears in the stylesheet like so .calibre25 { -aw-bookmark-end: _Hlk91081997; } I tried deleting those rules (ie removing calibre25 from the stylesheet), but that did nothing. I tried removing the id number itself from the rules (so calibre25 was just empty), but nope. Obviously if I do a search and replace for <a id=> what I'm left with is a bunch of things like this <_Hlk91081997>, which then appear like that in the html and would still need to be manually removed individually. Using the remove unused css rules or the beautify all files tools didn't help either. Converting to DOCX and then back to EPUB worked, in that it got rid of the <a>s, but it messed up a lot of the other formatting. If you have an idea, please explain like I'm 5, I'm not super tech-savvy! |
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,884
Karma: 9600930
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Find: <a id=".*?">
Replace: leave it blank Set your search mode to Regex and All text files. step through a couple one at a time to make sure it works as expected, then use Replace All if it is working correctly. Don't know where the calibre25 comes from or how it fits into it. |
|
|
|
| Advert | |
|
|
|
|
#3 | |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 208
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
|
Quote:
RE calibre25: I had no idea what might be relevant, so I was trying to provide as much info as possible, is all. |
|
|
|
|
|
|
#4 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 84,211
Karma: 153715495
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Even easier is to use Diaps Editing Toolbag in the calibre editor.
|
|
|
|
|
|
#5 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,884
Karma: 9600930
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Great! Glad it worked.
|
|
|
|
| Advert | |
|
|
|
|
#6 |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,889
Karma: 64184592
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I clean the CSS (what you showed) entry of any -aw-bookmark (there are start and end types)
Code:
\.calibre\d+ \{\s+\-aw\-bookmark\-.+?: .+?\s+\}
any calibre number { any that start with the phrase } |
|
|
|
|
|
#7 | |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53,208
Karma: 181177243
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
I'm using Sigil so I delete all the -aw-bookmark items from the CSS, remove unused from the text and then use the editing toolbox to remove any naked <a> tags. Last edited by DNSB; 07-17-2026 at 01:53 PM. |
|
|
|
|
|
|
#8 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53,208
Karma: 181177243
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
|
|
|
|
|
|
#9 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,884
Karma: 9600930
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
|
|
|
|
|
|
#10 |
|
(who/what)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 578
Karma: 5500000
Join Date: Feb 2003
Device: Kindle: Voyage,PW1,KOA, Kobo: Clara Colour, Nook GLP, Pocketbook verse
|
It may be worth noting that you can set up Calibre's file conversion to remove all <a> tags: In "the "Look and Feel" part go to the "Transform HTML" tab (last tab.
Add a rule that sets "If the tag name is" to "a" and select "remove tag only" as the action. Its always amazing how much is packed into Calibre! |
|
|
|
|
|
#11 | |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53,208
Karma: 181177243
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
That is one reason I personally preferred to use KindleUnpack to convert azw3/KF8 to ePub. Last edited by DNSB; 07-17-2026 at 05:41 PM. |
|
|
|
|
|
|
#12 | |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53,208
Karma: 181177243
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
|
|
|
|
|
|
|
#13 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 84,211
Karma: 153715495
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
So don't do this or you could ruin the eBook. |
|
|
|
|
![]() |
| Tags |
| calibre, css |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Quick question about IDs | Joliet Jake | Library Management | 15 | 09-19-2023 07:37 PM |
| Quick way to remove multiple libraries? | Rellwood | Library Management | 2 | 06-19-2022 06:14 PM |
| Bulk remove Book IDs | BetterRed | Calibre | 2 | 10-30-2013 03:47 AM |
| Simple and quick tool to convert epub to mobi? (on Mac!) | FlorenceArt | Kindle Formats | 35 | 12-12-2012 03:37 AM |
| Quick way to fix simple things in mobi | nounlu | Kindle Formats | 10 | 08-31-2010 04:14 PM |