Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 05-04-2021, 03:28 AM   #1
morty92222
Enthusiast
morty92222 began at the beginning.
 
morty92222's Avatar
 
Posts: 35
Karma: 10
Join Date: Dec 2019
Device: Kindle Paperwhite
How to prevent line-break before and after html tags?

So, I am using <q> and </q> to create « and ».

However, when I convert the epub to KFX, these tags allow for line-breaks before and after themselves sparingly. I attached a picture.

The text direction is rtl.

Finally, why does Kindle leaves so much space at the bottom. It is not always present. But I can't determine based on what it leaves space or start the new paragraph. The only thing I could think of is that if the following paragraph less than 2 lines, it does not start it on the previous page as not to leave one line by itself on the following page.
Attached Thumbnails
Click image for larger version

Name:	804C989F-DA93-49A7-9E02-1C48D5674650_1_201_a.jpeg
Views:	95
Size:	1.13 MB
ID:	186923   Click image for larger version

Name:	4D0BF57C-52B2-4F81-8F3D-3550E1A77BF6_1_201_a.jpeg
Views:	92
Size:	604.7 KB
ID:	186924  
morty92222 is offline   Reply With Quote
Old 05-04-2021, 10:10 AM   #2
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 4,585
Karma: 44555555
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
Quote:
Originally Posted by morty92222 View Post
So, I am using <q> and </q> to create « and ».

However, when I convert the epub to KFX, these tags allow for line-breaks before and after themselves sparingly. I attached a picture.
I don't know why, but Amazon's conversion to KFX inserts a zero width space before and after the quote marks generated by the <q> element, which allows a line break there. To avoid that use the left double quotation mark and right double quotation mark Unicode characters instead of <q>.

Quote:
Originally Posted by morty92222 View Post
Finally, why does Kindle leaves so much space at the bottom. It is not always present. But I can't determine based on what it leaves space or start the new paragraph. The only thing I could think of is that if the following paragraph less than 2 lines, it does not start it on the previous page as not to leave one line by itself on the following page.
That is done by default in KFX to avoid widows and orphans, which are single lines at the top or bottom of a page. You can disable that by setting the widows:1 and orphans:1 properties in CSS. (More information in this thread.)
jhowell is offline   Reply With Quote
Advert
Old 05-04-2021, 01:34 PM   #3
morty92222
Enthusiast
morty92222 began at the beginning.
 
morty92222's Avatar
 
Posts: 35
Karma: 10
Join Date: Dec 2019
Device: Kindle Paperwhite
Quote:
Originally Posted by jhowell View Post
I don't know why, but Amazon's conversion to KFX inserts a zero width space before and after the quote marks generated by the <q> element, which allows a line break there. To avoid that use the left double quotation mark and right double quotation mark Unicode characters instead of <q>.



That is done by default in KFX to avoid widows and orphans, which are single lines at the top or bottom of a page. You can disable that by setting the widows:1 and orphans:1 properties in CSS. (More information in this thread.)

Thank you so much! If I use the unicode, there won't be a method to control the <q> from css. For example, using <q> allows me to use quotes property to change which characters to use as quotations. Is there a way to keep that?
morty92222 is offline   Reply With Quote
Old 05-04-2021, 02:12 PM   #4
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 4,585
Karma: 44555555
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
Quote:
Originally Posted by morty92222 View Post
Thank you so much! If I use the unicode, there won't be a method to control the <q> from css. For example, using <q> allows me to use quotes property to change which characters to use as quotations. Is there a way to keep that?
As far as I can tell if you use <q> for quotes in KFX it will always allow line breaks on either side of them. I don't know of any way to prevent that.
jhowell is offline   Reply With Quote
Reply

Tags
conversion, epub, kfx, kindle

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to prevent calibre add a blank line at every <p> Nick_1964 Conversion 12 11-26-2013 05:44 AM
HTML input plugin stripping text within toc tags in child html file nimblebooks Conversion 3 02-21-2012 03:24 PM
How to prevent adding tags? Piper65 Library Management 17 01-21-2011 08:17 AM
Prevent Calibre to paragraph each line armkbdotcom Calibre 3 05-29-2010 03:15 PM
Prevent downloading tags when fetching metadata? Hi! Calibre 4 09-06-2009 08:42 AM


All times are GMT -4. The time now is 05:16 AM.


MobileRead.com is a privately owned, operated and funded community.