|
|
#1 |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 479
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
|
Remove undefined classes from html?
The editor has a function to remove unused CSS rules. Is there a function to remove undefined classes from the html files? If not, is there a reason such a function would not be a good idea?
|
|
|
|
|
|
#2 |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,370
Karma: 62500000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Not auto-magic, but Diaps toolbag can do 1 (case definition) at a time.
It also can remove or modify 'naked' tags. Now for your other Q. Should you ![]() Maybe. My device mishandles some things (or I just hate the effect). I can just comment out the offending CSS without destroying the original intent. That leaves a simple recovery path. If I nuke the class code. It is just GONE.
|
|
|
|
| Advert | |
|
|
|
|
#3 | |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 479
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
|
Quote:
If it's just an undefined class there doesn't seem much risk. Emptying or removing a CSS class, then removing that class from the html is higher risk, but if there's no apparent visual effect the risk seems rather low. |
|
|
|
|
|
|
#4 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 49,041
Karma: 174631586
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Personally, I've been using Sigil with the cssUndefinedClasses plugin for that task. I do switch between Sigil and calibre's ebook-editor when editing since both have tools that make some tasks easier.
|
|
|
|
|
|
#5 | |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 479
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
|
Quote:
|
|
|
|
|
| Advert | |
|
|
|
|
#6 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 81,261
Karma: 150263711
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
You can use Diaps Editing Toolbag to remove empty <div> and <span>. |
|
|
|
|
|
|
#7 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,716
Karma: 28549306
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The remove unused CSS tool already has an option to remove unused class attributes.
|
|
|
|
|
|
#8 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 81,261
Karma: 150263711
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Quick way to remove all class invokations for missing classes? | Vanguard3000 | Sigil | 8 | 10-12-2023 02:22 PM |
| Removal of undefined classes from text | mcdummy | Editor | 16 | 07-08-2020 08:45 AM |
| HTML to EPUB, how to keep classes? | MistaPrime | Conversion | 27 | 07-30-2019 11:33 AM |
| Pseudo classes to be deleted as unused classes | Leonatus | Sigil | 2 | 09-23-2018 10:12 AM |
| Is there way to list undefined classes? | phossler | Editor | 10 | 07-29-2018 10:33 PM |