![]() |
#1 |
Jeffrey A. Carver
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,199
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. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Jeffrey A. Carver
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,355
Karma: 1107383
Join Date: Aug 2008
Location: Massachusetts, USA
Device: Lenovo Yoga Tab Plus, Droid phone, Nook HD+
|
Quote:
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.) |
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#5 | |
Jeffrey A. Carver
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,355
Karma: 1107383
Join Date: Aug 2008
Location: Massachusetts, USA
Device: Lenovo Yoga Tab Plus, Droid phone, Nook HD+
|
Quote:
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. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,199
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
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |