05-25-2023, 07:13 AM | #1 |
Junior Member
Posts: 3
Karma: 10
Join Date: Feb 2011
Device: Kobo Aura H2Ov2, iPod Touch
|
How to prevent line-breaks?
Hi all,
I have a few fantasy books where telepathic dialogue is marked in non-standard ways, for example: *Hi! How are you?* <Hello. I'm good.> And every now and then, when the line-breaks line up just right, they end up like this: *Hi! How are you? * <Hello. I'm good. > I've been trying to figure out a way to prevent line-breaks with the beginning and end "quotes" but haven't had any luck. I use Sigil to edit and prefer epub2, and side-load using Calibre. I also prefer justified (over ragged-right), and have my <p> tag set to text-align: justify. I've been trying this in the stylesheet: .nowrap {white-space: nowrap; line-break-inside: avoid;} Looks like this in the html file: <p><i><span class="nowrap">*Hi!</span> How are <span class="nowrap">you?*</span></i></p> But it doesn't seem to be working. I'd appreciate some expert advice! |
05-25-2023, 12:12 PM | #2 |
Wizard
Posts: 1,142
Karma: 5061953
Join Date: Jun 2011
Location: Ontario, Canada
Device: Kobo Aura HD
|
Not tested, (and would have be tested on both epub and kepub).. But here's the technical answer.
https://stackoverflow.com/questions/...breaking-space Since a nowrap span is not working, I was thinking you could try putting a word-joiner, ⁠ ; between your punctuation and the * / >. Last edited by rashkae; 05-25-2023 at 12:19 PM. |
05-25-2023, 04:12 PM | #3 | |
Junior Member
Posts: 3
Karma: 10
Join Date: Feb 2011
Device: Kobo Aura H2Ov2, iPod Touch
|
it worked!
Quote:
New text: *Hi! How are you?⁠ ;* <Hello. I'm good.⁠ ;> (space before ; deleted though) I had a little bit of a scare when I added it in, then used Sigil's clean-up to prettify the html file and it disappeared... until I remembered to add it to the "Preserve Entities" exclusions in Preferences and they all came back. So it'll be there when I forget it too... I am now going to open all my book files, and put this little baby everywhere... Last edited by Nirkatze; 05-25-2023 at 04:15 PM. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to prevent breaks within a 'word' | AlexBell | ePub | 15 | 11-11-2015 12:24 AM |
How to prevent page breaks? | bgoldnyxnet | ePub | 9 | 01-28-2014 09:45 AM |
How to prevent calibre add a blank line at every <p> | Nick_1964 | Conversion | 12 | 11-26-2013 05:44 AM |
Line breaks on Kindle, no line breaks on 4 PC | Siavahda | Kindle Formats | 0 | 10-20-2012 05:50 AM |
Prevent Calibre to paragraph each line | armkbdotcom | Calibre | 3 | 05-29-2010 03:15 PM |