![]() |
#1 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Oct 2011
Device: iBooks
|
HTML to ePub: Calibre inserts unwanted tags
While converting from HTML to ePub Calibre adds allegedly missing tags that are in fact not missing:
( 1 ) HTML: <p> aa <font ... > bb </font> cc </p> ePub: <p> aa </p> <font ... > bb </font> <p> cc </p> The result is that a paragraph is split mid-sentence into two paragraphs. ( 2 ) Same applies with "<span" instead of "<font" A browser displays the original ( 1 ) and ( 2 ) flawlessly, because this is simply valid HTML code. ( 3 ) An ugly workaround is to replace <p> by <br><br> and drop </p>, but that adds huge paragraph spacing. Is there a solution I missed, or should I report this as a bug right-away? |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,347
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Having opening <p> tags without closing ones is *not* valid HTML. Every <p> tag must be closed, calibre makes a guess about where it should be closed, that guess is, in this case, different from whatever browser you are using, that is not a bug in calibre. You need to fix your HTML.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Oct 2011
Device: iBooks
|
Sorry, I do have matching pairs (first and last tag is <p> and </p> in each example, and <span> within <p> is valid HTML (you might wish to google html span within paragraph), but your answer is sufficient.
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,347
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you have proper closing tags in your document then calibre *will not* insert tags of its own. For example convert eh following html:
Code:
<html> <body> <p>A <span>span</span> tag.</p> </body> </html> Code:
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml"> <head><title>Unknown</title><meta content="http://www.w3.org/1999/xhtml; charset=utf-8" http-equiv="Content-Type"/><link href="stylesheet.css" type="text/css" rel="stylesheet"/><style type="text/css"> @page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; }</style></head><body class="calibre"> <p class="calibre1">A <span>span</span> tag.</p> </body> </html> |
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Oct 2011
Device: iBooks
|
Oh, you talked about the <html> and <body> tags, these I had indeed omitted, and that is of course no valid HTML code :-). I apologize for having caused this mess.
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with html -> Mobi conversion - html tags visible. | khromov | Calibre | 9 | 08-06-2011 11:25 AM |
epub to mobi - Displays Html tags | stevec1409 | Conversion | 7 | 02-14-2011 03:41 PM |
HTML Metadata for use as ePub tags | myudkowsky | Calibre | 9 | 12-12-2010 12:45 PM |
HTML-to-ePub tool that beats Calibre? | varelov | ePub | 2 | 11-17-2010 09:31 PM |
Calibre: HTML => ePub: Anführungszeichen verloren | buecherkorb | Software | 2 | 01-30-2010 09:16 AM |