View Single Post
Old 07-02-2020, 12:44 PM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,361
Karma: 20212223
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
dang it - Ninja'd again...


There are a lot of things that Calibre can do, but you certainly don't need to switch to it for simple spaces between lines.

One thing I think you may be getting confused about... Sigil can 'clean up' the display of your code so that it looks nice on the screen. This has zero effect on your epub. ePub readers/apps ignore blank space between the html tags like <p></p><p> etc. The tidying up that Sigil does just makes it easier to see your code and work on it. If you really don't like it doing this, you can go into Sigil's preferences and turn off the feature. I'm pretty sure it is default to run on open and on save. I personally have both of them turned off and then just right click on a file when I want to use this feature.

As a matter of style - it really makes book makers shudder if there are any blank/empty paragraphs just to create space between paragraphs like this:
Code:
<p>This is a normal paragraph.</p>
<p></p>
<p>This is a normal paragraph with space before and after.</p>
<p></p>
<p>This is a normal paragraph.</p>
It is much better to put your desired spacing in the css file.

eg.
Code:
.spacing {margin:2em 0}

<p>This is a normal paragraph.</p>
<p class="spacing">This is a normal paragraph with space before and after.</p>
<p>This is a normal paragraph.</p>
-- and don't forget to link your css file to your html files...

In your case, where you want to add asterisks to make a scene break, I would just put the asterisks in its own <div> and use css to style it however you want.

Code:
.SceneBreak {margin:2em auto; text-align:center; letter-spacing:1.5em}

<p>This is a normal paragraph.</p>
<div class="SceneBreak">*****</div>
<p>This is a normal paragraph after a scene break.</p>
<p>This is a normal paragraph.</p>
Be aware, also, that there is another discussion going on, in this thread, about the accessibility standards recommend using an <hr class="SceneBreak" /> to make your ePub more compliant.

As for a way to search and replace you can try the following regex. Caution: make a backup of your file, and don't use 'replace all' until you are sure the pattern is working for you.

find: <p class="Normal-space-after">(.*?)</p>
replace: <p>\1</p>\n<div class="SceneBreak">*****</div>

Cheers!

Last edited by Turtle91; 07-02-2020 at 12:50 PM.
Turtle91 is offline   Reply With Quote