09-13-2018, 07:45 PM | #16 | |
Addict
Posts: 378
Karma: 1638210
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Ubuntu, Jutoh,Kobo Forma
|
Quote:
Other than beautifying, I have a couple of things that help. One is a saved search that replaces spaces before a </p> or </div>. The other is my dynamite fix for files that have way too much white space: regex search for \n and replace it with a space. Then search for two spaces and replace with a single space--run that a few times until the results hit zero replacements. Then beautify the file. This will neaten up the worst mess imaginable, and I've never yet had it destroy a file, even though it looks like it will after the first step! |
|
09-13-2018, 10:52 PM | #17 |
Book E d i t o r
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
|
You can do various searches, but you always have to run Beautify Files first for the search function to work, no matter what you'll be searching for.
After you run Beautify Files, then you can run just one Regex search for \s+</p> and replace with </p>--to delete one space or more than one space with this simple command. There's no need to run multiple searches to delete the spaces before ending tags, such as </p>, </div>, </span>, etc. You don't even have to run Beautify Files afterward, since you ran it before the search. |
09-13-2018, 11:15 PM | #18 | |
Grand Sorcerer
Posts: 24,908
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
For the situation that @roger64 is reporting, I generally do that fairly early, so it is before the beautify. I haven't had any issues doing this. A problem is exactly what type of space is used in these otherwise empty paragraphs. Generally, it means selecting one and pressing CTR+F and change that, and then repeating this with one of the ones that were missed gets the rest. It would be interesting to see the original file to see what was actually going on. |
|
09-13-2018, 11:16 PM | #19 |
creator of calibre
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The test file you sent me has
Code:
<p>(non breaking space as an HTML entity)</p> Code:
<p>(non breaking space as an entity)</p> |
09-14-2018, 01:20 AM | #20 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
@kovidgoyal
Thank you for your explanation. I shall pay attention to the way these offending characters may have been introduced in the ePub. Thanks to all for your useful various tips. Last edited by roger64; 09-14-2018 at 01:23 AM. |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Searching for empty entries | reluniks | Calibre | 2 | 11-12-2016 02:29 PM |
Searching for empty | tadas | Library Management | 2 | 04-20-2015 12:14 AM |
Empty space in Paragraph | odedta | ePub | 11 | 12-27-2014 09:18 AM |
How detelete empty paragraph? | cyttorak | Recipes | 2 | 11-27-2014 02:41 AM |
Searching for empty tags | iain_benson | Calibre | 2 | 01-27-2009 05:04 PM |