View Single Post
Old 01-21-2012, 12:33 AM   #1
Y|yukichigai
Junior Member
Y|yukichigai ought to be getting tired of karma fortunes by now.Y|yukichigai ought to be getting tired of karma fortunes by now.Y|yukichigai ought to be getting tired of karma fortunes by now.Y|yukichigai ought to be getting tired of karma fortunes by now.Y|yukichigai ought to be getting tired of karma fortunes by now.Y|yukichigai ought to be getting tired of karma fortunes by now.Y|yukichigai ought to be getting tired of karma fortunes by now.Y|yukichigai ought to be getting tired of karma fortunes by now.Y|yukichigai ought to be getting tired of karma fortunes by now.Y|yukichigai ought to be getting tired of karma fortunes by now.Y|yukichigai ought to be getting tired of karma fortunes by now.
 
Posts: 5
Karma: 472332
Join Date: Jul 2010
Device: iPhone
Can't get rid of &nbsp "paragraphs" when converting

I'm having a rather frustrating problem converting a few HTML ebooks I have. I'm converting them to ePub, but this happens with almost any format I convert to.

The problem I'm having is that the converted ePub has triple-spacing between each paragraph. I checked the source HTML file and discovered the cause: each paragraph has an extra "spacing" paragraph containing only one non-breaking space (&nbsp). The spacing paragraphs are all identical:

Code:
<p style='margin:0mm;margin-bottom:.0001pt;text-indent:36.0pt'><span
style='font-size:14.0pt;font-family:"Calibri","sans-serif"'>&nbsp;</span></p>
I figured I could strip this out easily using Search and Replace, so I set up a quick regex to find the paragraphs in question. When tested it worked just as intended... at least in test:

Code:
<p .*>\s*</span></p>
Unfortunately, that didn't work. For whatever reason the rule doesn't trigger during conversion at all, and yes I've tried with something other than a blank space in the Replacement Text field. I've tried replacing \s* with &nbsp; to no effect. I've even tried copying the entire paragraph code into the Search field: no luck. I'm at a loss here. Any ideas?

Oh, and using the "remove spacing between paragraphs" option does nothing, before someone suggests it.
Y|yukichigai is offline   Reply With Quote