Quote:
Originally Posted by Rev. Bob
I wish I could think of a way to automatically detect and discard pointlessly-nested DIV elements...
|
I don't have a way of automatically removing these useless DIVs but just in case it sparks a few ideas I've been getting rid of mine using the calibre Editor like this:
- Look through the css sheet and manually delete 'style-less' (IMO) styles e.g. .xyz {display: block} or .xyz {page-break-before:always}
- Run the Editor's 'Remove Unused css Rules & Classes' option to convert the useless DIV-with-class's to empty DIVs.
- Run DiapDealer's Editing Toolbag plugin to remove the empty DIVs.
Steps 2 & 3 should be easy enough to automate as they're already Python code but step 1 would be a bit more contentious to determine if/when a style should be considered 'useless'.