Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 10-08-2011, 04:50 AM   #1
NTG
Junior Member
NTG began at the beginning.
 
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?
NTG is offline   Reply With Quote
Old 10-08-2011, 08:42 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is online now   Reply With Quote
Advert
Old 10-08-2011, 02:25 PM   #3
NTG
Junior Member
NTG began at the beginning.
 
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.
NTG is offline   Reply With Quote
Old 10-08-2011, 03:21 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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>
And you will get

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>
kovidgoyal is online now   Reply With Quote
Old 10-09-2011, 04:11 AM   #5
NTG
Junior Member
NTG began at the beginning.
 
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.
NTG is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
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


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


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