View Single Post
Old 01-29-2020, 02:41 PM   #7
Brett Merkey
Not Quite Dead
Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.
 
Posts: 195
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
Quote:
When you ask calibre to remove unused code, I think it leaves alone any line with multiple items, so long as at least one of them is being used:

div, ol, p, ul, .class1, .class2 {whatever}
So far as I can tell, it will not remove any of the above so long as one of them is in the book. It would be great if it could remove the dead-wood items from a list.
I think I may have already posted this, but you can unstack those selectors in the CSS with a regular expression:

--unstack selectors so Calibre "Remove unused rules" tool can be used:
Search: ([.]?[^ ]+),\s([^{]+)(\{[^}]+\})
Replace: \1 \3\n\n\2\3

'Replace All' until 0 returns.
Brett Merkey is offline   Reply With Quote