View Single Post
Old 07-11-2015, 07:54 PM   #983
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,257
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by Rev. Bob View Post
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:
  1. Look through the css sheet and manually delete 'style-less' (IMO) styles e.g. .xyz {display: block} or .xyz {page-break-before:always}
  2. Run the Editor's 'Remove Unused css Rules & Classes' option to convert the useless DIV-with-class's to empty DIVs.
  3. 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'.
jackie_w is offline   Reply With Quote