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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-31-2014, 03:59 AM   #1
starrigger
Jeffrey A. Carver
starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.
 
starrigger's Avatar
 
Posts: 1,355
Karma: 1107383
Join Date: Aug 2008
Location: Massachusetts, USA
Device: Lenovo Yoga Tab Plus, Droid phone, Nook HD+
Epub conversion - headers showing up as pseudo-hyperlinks

This may have been going on for a while, but it was just brought to my attention in some recent book conversions. The books were brought into Calibre as filtered html from Word, and some of the headers in the book (for example, the About the Author section at the end) were bookmarked in Word as anchors for hyperlinks from a TOC at the front. In the past, this has worked flawlessly; the links went to the section headers, and the headers looked like any other H1 style header.

Now what I'm getting is headers that look as if they are hyperlinks (blue, sometimes underlined, cursor changes on mouseover, etc.) but that don't link to anything. And they shouldn't; they're targets, not links.

I can't see anything wrong in the source files, but in recent conversions, I've been seeing this result fairly consistently in the epubs (not the mobi). The problem does not show up in the Calibre viewer, but it does in ADE.

I can't figure out what's causing it, and I wonder if it's a bug that crept in somewhere along the line. (I looked at some older conversions just to check, and the problem didn't occur in them. Those were over a year old, though.)

I'm trying to attach the source and output files of one example, but the system here doesn't want to accept the .docx or html files. With luck, the epub at least will upload. Okay, and the .zip of the input file. These I believe were converted with Calibre 1.29. I just ran it again and captured the conversion details, attached.

As far as any changes from defaults, I'm not really sure, but here's one line I know I changed that might bear on it. It's the "detect chapters at" under Structure Detection:

//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part|prologue|epilogue\s+', 'i')) or @class = 'chapter']

I hope this helps.
starrigger is offline   Reply With Quote
Old 03-31-2014, 05:12 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,200
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
This is a bug in ADE where it incorrectly displays anchors as links. calibre used to explicitly workaround that bug, but it stopped doing that, as the workaround can break rendering in compliant epub renderers. You will have to apply the workaround manually.

Probably the following in extra css will do the trick

a { text-decoration: none; color: black; }

a[href] { text-decoration: underline; color: blue; }

or something along those lines, it's been a while since I touched ADE.
kovidgoyal is offline   Reply With Quote
Advert
Old 03-31-2014, 12:27 PM   #3
starrigger
Jeffrey A. Carver
starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.
 
starrigger's Avatar
 
Posts: 1,355
Karma: 1107383
Join Date: Aug 2008
Location: Massachusetts, USA
Device: Lenovo Yoga Tab Plus, Droid phone, Nook HD+
Quote:
Originally Posted by kovidgoyal View Post
This is a bug in ADE where it incorrectly displays anchors as links. calibre used to explicitly workaround that bug, but it stopped doing that, as the workaround can break rendering in compliant epub renderers. You will have to apply the workaround manually.

Probably the following in extra css will do the trick

a { text-decoration: none; color: black; }

a[href] { text-decoration: underline; color: blue; }

or something along those lines, it's been a while since I touched ADE.
Thanks, Kovid. You're saying ADE has had this bug all along and they've never fixed it? (!!)

So I tried pasting those two lines into the Extra CSS section of the conversion, and it didn't help. Was I being too literal about how to apply the fix?

And instead of "color: black" could I use "color: none" to avoid messing up night-setting displays? (Assuming I could get the fix to work.)
starrigger is offline   Reply With Quote
Old 03-31-2014, 02:15 PM   #4
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,249
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
color:inherit may be worth a try.
jackie_w is offline   Reply With Quote
Old 03-31-2014, 03:47 PM   #5
starrigger
Jeffrey A. Carver
starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.starrigger ought to be getting tired of karma fortunes by now.
 
starrigger's Avatar
 
Posts: 1,355
Karma: 1107383
Join Date: Aug 2008
Location: Massachusetts, USA
Device: Lenovo Yoga Tab Plus, Droid phone, Nook HD+
Quote:
Originally Posted by kovidgoyal View Post
This is a bug in ADE where it incorrectly displays anchors as links. calibre used to explicitly workaround that bug, but it stopped doing that, as the workaround can break rendering in compliant epub renderers. You will have to apply the workaround manually.

Probably the following in extra css will do the trick

a { text-decoration: none; color: black; }

a[href] { text-decoration: underline; color: blue; }

or something along those lines, it's been a while since I touched ADE.
Actually, I think the problem is in the conversion. I just looked at the conversion output for one of my omnibus editions that has an inline TOC pointing to each of three books inside it, plus sections such Books by.

Here's what one of the TOC links looks like:

<p class="TOCHyperlink"><a class="pcalibre pcalibre1" href="../Text/ChaosChronicles_BVC_final_split_003.htm#neptune">N EPTUNE CROSSING</a></p>

And here's what the target of the link looks like:

<h2 class="calibre9" id="calibre_toc_3"><a class="pcalibre calibre10 pcalibre1" id="neptune">BOOK 1: NEPTUNE CROSSING</a></h2>

Both have the
class="pcalibre pcalibre1"

which when I look at the stylesheet shows this:

.pcalibre:visited {
color: purple;
text-decoration: underline
}
.pcalibre1:link {
color: blue;
text-decoration: underline

Which, to me, looks as if the problem isn't in ADE, but in the conversion. It's giving the same display attributes to both the link and the target. Am I crazy? If I'm reading that correctly, then the Calibre conversion is wrongly assigning a style to the target that it shouldn't have.


Here's the corresponding code from the source html:

The link in the TOC:
<p class=TOCHyperlink><a href="#neptune">NEPTUNE CROSSING</a></p>

The destination:
<h2><a name=neptune>BOOK 1: NEPTUNE CROSSING</a></h2>

And from the stylesheet:

p.TOCHyperlink, li.TOCHyperlink, div.TOCHyperlink
{mso-style-name:"TOC Hyperlink";
margin-top:12.0pt;
margin-right:0in;
margin-bottom:12.0pt;
margin-left:0in;
text-align:center;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:blue;
font-weight:bold;
text-decoration:underline;}

For the destination (a name=neptune) I don't see anything in the stylesheet.

It really seems as if Calibre is assigning the same display/decoration qualities to the destination text that it assigns to the link text, when that's not in the source.

I could be wrong. I'm at the edge of my knowledge base here.
starrigger is offline   Reply With Quote
Advert
Old 03-31-2014, 10:26 PM   #6
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,200
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You said in your first post that the incorrect display happened only in ADE. Therefore it is unlikely to be a conversion problem. But if you feel otherwise, you know what to do: https://www.mobileread.com/forums/sho...d.php?t=186697
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Touch CSS pseudo-elements in an EPUB: Supported? Benjamin Buford Kobo Reader 10 07-07-2011 03:08 AM
Unwanted headers in conversion BobES Conversion 1 06-07-2011 12:21 PM
Missing TOC, top/bottom margins and hyperlinks in ePub -> PDF conversion amoroso Conversion 2 04-26-2011 10:48 AM
PDF to ePub conversion issue - headers getting left in deadSkip Calibre 7 07-09-2010 02:07 AM
Evading headers in PDF->EPUB conversion davef Calibre 6 08-29-2009 03:26 PM


All times are GMT -4. The time now is 07:36 PM.


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