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

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 06-04-2012, 07:26 AM   #1
stam.scribe
Junior Member
stam.scribe began at the beginning.
 
stam.scribe's Avatar
 
Posts: 5
Karma: 10
Join Date: Jun 2012
Device: none
Kindle (sometimes) displays bits of HTML

I’m having a weird display problem with a mobi file I’m working on: The ebook has endnotes, with the links in each endnote back to the original text. For 2 of the 16 endnotes, when I jump back to the text from the note, the first line of text on the kindle screen starts with a bit of code like this:

p height=”1em” width=”0pt”>

I searched through the original HTML file, but I couldn’t find any difference between those 2 links and any of the other ones which could account for this issue.

This happens on a regular Kindle and in the “Kindle Previewer” app for Mac but not in the Kindle apps for iOS or Mac.

Here’s a screenshot from Kindle Previewer for Mac:


The Mobi file was created by Calibre from a hand-coded HTML file.

Any idea what could be causing this?
TIA

Last edited by stam.scribe; 06-04-2012 at 07:38 AM. Reason: Inserting image
stam.scribe is offline   Reply With Quote
Old 06-04-2012, 07:51 AM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,441
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
It's a known bug with Kindle devices. It's even exhibited in the Kindle Previewer. The way to avoid it is to put your anchor point before/outside of the element you're trying to link to.

Consider this end-note link encountered in the text of a document:
Code:
<a href="#endnote1">[1]</a>
This anchor point (target) can exhibit the issue you're seeing:
Code:
<p id="endnote1" class="endnote">This is my first endnote.</p>
This is what you need to do to make sure it doesn't happen:
Code:
<a id="endnote1" /><p class="endnote">This is my first endnote.</p>
or:
Code:
<a id="endnote1"></a><p class="endnote">This is my first endnote.</p>
My example isn't exactly like your backlink, but the principle is the very same: put the anchor you're linking to before/outside of the element (p, h1, h2, h3, etc...) you're shooting for.

Last edited by DiapDealer; 06-04-2012 at 07:55 AM.
DiapDealer is offline   Reply With Quote
Old 06-04-2012, 09:49 AM   #3
stam.scribe
Junior Member
stam.scribe began at the beginning.
 
stam.scribe's Avatar
 
Posts: 5
Karma: 10
Join Date: Jun 2012
Device: none
Quote:
Originally Posted by DiapDealer View Post
It's a known bug with Kindle devices. It's even exhibited in the Kindle Previewer. The way to avoid it is to put your anchor point before/outside of the element you're trying to link to.
Thank you! I’ll try that and see is it helps.

Any idea why the bug would always show up in the same 2 places and never show up anywhere else? There in no difference (that i can see) in the code.
stam.scribe is offline   Reply With Quote
Old 06-04-2012, 10:42 AM   #4
stam.scribe
Junior Member
stam.scribe began at the beginning.
 
stam.scribe's Avatar
 
Posts: 5
Karma: 10
Join Date: Jun 2012
Device: none
Aaaand… DiapDealer’s solution fixed my problem… and introduced a new problem: When the <a id=“whatever> tags are outside the <p> tags, any space between paragraphs (specified in CSS) is stripped out.

Any thoughts?
stam.scribe is offline   Reply With Quote
Old 06-04-2012, 11:16 AM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,441
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Hmm... I've never experienced that problem. But that's likely due to the fact that I rarely have any space between my paragraphs except at scenebreaks... and I normally use Kindlegen to produce my MOBIs. But it still should be possible to get it worked out.

Any chance of getting a sample snippet of the html and css involved? Just a couple of paragraphs where spacing is expected and it's not coming through on the MOBI end?

Last edited by DiapDealer; 06-04-2012 at 12:36 PM.
DiapDealer is offline   Reply With Quote
Old 06-04-2012, 12:22 PM   #6
susan_cassidy
Wizard
susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.
 
Posts: 2,251
Karma: 3720310
Join Date: Jan 2009
Location: USA
Device: Kindle, iPad (not used much for reading)
Make sure you close the anchor tag. DiagDealer's example didn't show the anchor closure.
susan_cassidy is offline   Reply With Quote
Old 06-04-2012, 12:36 PM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,441
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by susan_cassidy View Post
Make sure you close the anchor tag. DiagDealer's example didn't show the anchor closure.
Huh?
I gave one example with a self-closing xhtml tag and one with a traditional html open/close tag pair. What did I miss?

Last edited by DiapDealer; 06-04-2012 at 01:12 PM.
DiapDealer is offline   Reply With Quote
Old 06-04-2012, 01:40 PM   #8
susan_cassidy
Wizard
susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.
 
Posts: 2,251
Karma: 3720310
Join Date: Jan 2009
Location: USA
Device: Kindle, iPad (not used much for reading)
Sorry, I missed the closing slash in the anchor tag. I'm not used to anchors without text enclosed.
susan_cassidy is offline   Reply With Quote
Old 06-04-2012, 03:01 PM   #9
stam.scribe
Junior Member
stam.scribe began at the beginning.
 
stam.scribe's Avatar
 
Posts: 5
Karma: 10
Join Date: Jun 2012
Device: none
I’m trying to generate a small mobi file that shows the problem by copying out a few paragraphs from the original HTML… Of course, in the sample file the problem doesn’t exist…

I will have to spend some more time on this later/tomorrow. Stay tuned...
stam.scribe is offline   Reply With Quote
Old 06-04-2012, 03:31 PM   #10
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,441
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by stam.scribe View Post
I’m trying to generate a small mobi file that shows the problem by copying out a few paragraphs from the original HTML… Of course, in the sample file the problem doesn’t exist…

I will have to spend some more time on this later/tomorrow. Stay tuned...
Just so you know, a smattering of the original html and css will be a lot more helpful in diagnosing the issue than just a small mobi exhibiting the wrong behavior would be by itself... if you do end up posting something.

Good luck.
DiapDealer is offline   Reply With Quote
Old 06-06-2012, 04:02 AM   #11
stam.scribe
Junior Member
stam.scribe began at the beginning.
 
stam.scribe's Avatar
 
Posts: 5
Karma: 10
Join Date: Jun 2012
Device: none
Hmmm… So I generated a new mobi file from the original HTML and it displayed the same problem. Then I commented out most of the ebook (except the relevant sections) and made another mobi which didn’t have the problem. Then I tried adding in more and more of the original HTML to try to find the point where the problem begins… after 10 or 15 tries, I’m back to the full text and no display issue (at least not in the Previewer app — I have to borrow a real Kindle to make sure it’s not there as well).

Weird. The problem was consistently present even after multiple edits to the HTML file — until I took most of the text out and then put it right back in.

Why would that matter???
stam.scribe is offline   Reply With Quote
Old 06-06-2012, 08:55 AM   #12
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,441
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Why would that matter???
Beats me. It shouldn't make a difference if everything is truly the same. Use an editor that that can compare/show the differences between two files in order to compare the old to the new (html and css). It may pick up on something the eye is missing.
DiapDealer is offline   Reply With Quote
Old 06-06-2012, 01:53 PM   #13
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by stam.scribe View Post
Thank you! I’ll try that and see is it helps.

Any idea why the bug would always show up in the same 2 places and never show up anywhere else? There in no difference (that i can see) in the code.
I afraid I have to disagree with the view that this is a bug. It isn't a bug; it's simply a consequence of the fact that Mobi is stateless; when you jump to a point in the file in a Mobi book the HTML is rendered from that point onwards. When placing anchors in your code, you need to bear this in mind.
HarryT is offline   Reply With Quote
Old 06-06-2012, 02:11 PM   #14
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,441
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by HarryT View Post
I afraid I have to disagree with the view that this is a bug. It isn't a bug; it's simply a consequence of the fact that Mobi is stateless; when you jump to a point in the file in a Mobi book the HTML is rendered from that point onwards. When placing anchors in your code, you need to bear this in mind.
I was the first to say the word "bug" in the thread. So I'll take the blame if that's incorrect terminology. I would agree with you that it's "just the way mobi is," if the various kindle apps exhibited the same behavior. But they seem to be immune to this issue.
DiapDealer is offline   Reply With Quote
Old 06-06-2012, 06:26 PM   #15
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Quote:
Originally Posted by DiapDealer View Post
I was the first to say the word "bug" in the thread. So I'll take the blame if that's incorrect terminology. I would agree with you that it's "just the way mobi is," if the various kindle apps exhibited the same behavior. But they seem to be immune to this issue.
Well the Kindle apps have an additional step of converting the source code at the beginning due to their need to try and emulate CSS and other advanced constructs since they try and accept epub. MobiCreator only compiles code that it believes meets specifications (i.e. written for mobi in the first place).
DaleDe is offline   Reply With Quote
Reply

Tags
display problems, html, kindle

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle Previewer Displays HTML lists incorrectly when converting from EPUB Gandharva Kindle Developer's Corner 1 09-01-2011 06:52 PM
HTML to epub displays munged source code haven Conversion 4 03-10-2011 10:08 PM
epub to mobi - Displays Html tags stevec1409 Conversion 7 02-14-2011 03:41 PM
Calibre Recipe HTML content differs from raw html of index.html. krunk Calibre 4 09-20-2010 09:48 PM
Magnified Comparison of eInk / Kindle and iPad Displays Kali Yuga General Discussions 4 08-18-2010 08:51 AM


All times are GMT -4. The time now is 11:57 PM.


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