pgaskin / kepubify

Fast, standalone EPUB to Kobo EPUB conversion tool.
https://pgaskin.net/kepubify
MIT License
629 stars 34 forks source link

TOC entry always jump to first page/cover #52

Closed bangedorrunt closed 4 years ago

bangedorrunt commented 4 years ago

hi,

i'm having issue with the table of content entries which always jump to first page when i press on them. this doesn't happen with .epub files, only with .kepub. have you got any idea to resolve the problem?

pgaskin commented 4 years ago

I'd need to see the HTML file for the TOC.

bangedorrunt commented 4 years ago

@geek1011, the toc below is of .epub file

<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <title>Poor Economics</title>
  <link href="abhi_9781610390408_oeb_css_r1.css" rel="stylesheet" type="text/css"/>
  <link href="page-template.xpgt" rel="stylesheet" type="application/adobe-page-template+xml"/>
  <meta content="urn:uuid:bc221f41-45e9-4c0b-9247-fd47964c52cb" name="Adept.expected.resource"/>
</head>

<body>

  <p><a id="toc"></a></p>

  <div class="fmh1">Table of Contents</div>

  <div> <br/></div>

  <div class="cfmh"><a href="abhi_9781610390408_oeb_tp_r1.html">Title Page</a></div>

  <div class="cfmh"><a href="abhi_9781610390408_oeb_ded_r1.html">Dedication</a></div>

  <div class="cfmh"><a href="abhi_9781610390408_oeb_frw_r1.html">Foreword</a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c01_r1.html">Chapter 1 - Think Again, Again</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c01_r1.html#h1">TRAPPED IN POVERTY?</a></div>

  <div> <br/></div>

  <div class="cpt"><a href="abhi_9781610390408_oeb_p01_r1.html">PART I - Private Lives</a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c02_r1.html">Chapter 2 -  A Billion Hungry People?</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c02_r1.html#h1">ARE THERE REALLY A BILLION HUNGRY PEOPLE?</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c02_r1.html#h2">ARE THE POOR REALLY EATING WELL, AND EATING ENOUGH?</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c02_r1.html#h3">WHY DO THE POOR EAT SO LITTLE?</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c02_r1.html#h4">SO IS THERE REALLY A NUTRITION-BASED POVERTY TRAP?</a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c03_r1.html">Chapter 3 -  Low-Hanging Fruit for Better (Global) Health?</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c03_r1.html#h1">THE HEALTH TRAP</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c03_r1.html#h2">WHY AREN’T THESE TECHNOLOGIES USED MORE?</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c03_r1.html#h3">UNDERSTANDING HEALTH-SEEKING BEHAVIOR</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c03_r1.html#h4">THE VIEW FROM OUR COUCH</a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c04_r1.html">Chapter 4 - Top of the Class</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c04_r1.html#h1">SUPPLY-DEMAND WARS</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c04_r1.html#h2">THE CURSE OF EXPECTATIONS</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c04_r1.html#h3">WHY SCHOOLS FAIL</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c04_r1.html#h4">REENGINEERING EDUCATION</a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c05_r1.html">Chapter 5 - Pak Sudarno’s Big Family</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c05_r1.html#h1">WHAT IS WRONG WITH LARGE FAMILIES?</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c05_r1.html#h2">DO THE POOR CONTROL THEIR FERTILITY DECISIONS?</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c05_r1.html#h3">CHILDREN AS FINANCIAL INSTRUMENTS</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c05_r1.html#h4">THE FAMILY</a></div>

  <div> <br/></div>

  <div class="cpt"><a href="abhi_9781610390408_oeb_p02_r1.html">PART II - Institutions</a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c06_r1.html">Chapter 6 - Barefoot Hedge-Fund Managers</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c06_r1.html#h1">THE HAZARDS OF BEING POOR</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c06_r1.html#h2">THE HEDGE</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c06_r1.html#h3">WHERE ARE THE INSURANCE COMPANIES FOR THE POOR?</a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c07_r1.html">Chapter 7 - The Men from Kabul and the Eunuchs of India: The (Not So) Simple  …</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c07_r1.html#h1">LENDING TO THE POOR</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c07_r1.html#h2">MICRO INSIGHTS FOR A MACRO PROGRAM</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c07_r1.html#h3">DOES MICROCREDIT WORK?</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c07_r1.html#h4">THE LIMITS OF MICROCREDIT</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c07_r1.html#h5">HOW CAN LARGER FIRMS BE FINANCED?</a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c08_r1.html">Chapter 8 -  Saving Brick by Brick</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c08_r1.html#h1">WHY THE POOR DON’T SAVE MORE</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c08_r1.html#h2">THE PSYCHOLOGY OF SAVINGS</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c08_r1.html#h3">POVERTY AND THE LOGIC OF SELF-CONTROL</a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c09_r1.html">Chapter 9 -  Reluctant Entrepreneurs</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c09_r1.html#h1">CAPITALISTS WITHOUT CAPITAL</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c09_r1.html#h2">THE BUSINESSES OF THE POOR</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c09_r1.html#h3">GOOD JOBS</a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c10_r1.html">Chapter 10 - Policies, Politics</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c10_r1.html#h1">POLITICAL ECONOMY</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c10_r1.html#h2">CHANGES AT THE MARGIN</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c10_r1.html#h3">DECENTRALIZATION AND DEMOCRACY IN PRACTICE</a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c10_r1.html#h4">AGAINST POLITICAL ECONOMY</a></div>

  <div> <br/></div>

  <div class="cbmh"><a href="abhi_9781610390408_oeb_bm1_r1.html">In Place of a Sweeping Conclusion</a></div>

  <div class="cbmh"><a href="abhi_9781610390408_oeb_ack_r1.html">Acknowledgements</a></div>

  <div class="cbmh"><a href="abhi_9781610390408_oeb_nts_r1.html">Notes</a></div>

  <div class="cbmh"><a href="abhi_9781610390408_oeb_in1_r1.html">Index</a></div>

  <div class="cbmh"><a href="abhi_9781610390408_oeb_cop_r1.html">Copyright Page</a></div>

</body>

</html>
bangedorrunt commented 4 years ago

the following toc is of .kepub.epub file

<?xml version='1.0' encoding='utf-8'?><html xmlns="http://www.w3.org/1999/xhtml"><head>
  <title>Poor Economics</title>
  <link href="abhi_9781610390408_oeb_css_r1.css" rel="stylesheet" type="text/css"/>
  <link href="page-template.xpgt" rel="stylesheet" type="application/adobe-page-template+xml"/>

<style type="text/css" class="kobostylehacks">div#book-inner { margin-top: 0; margin-bottom: 0;}</style></head>

<body><div id="book-columns"><div id="book-inner">

  <p><a id="toc"></a></p>

  <div class="fmh1"><span class="koboSpan" id="kobo.1.1">Table of Contents</span></div>

  <div>&#160;<br/></div>

  <div class="cfmh"><a href="abhi_9781610390408_oeb_tp_r1.html"><span class="koboSpan" id="kobo.1.2">Title Page</span></a></div>

  <div class="cfmh"><a href="abhi_9781610390408_oeb_ded_r1.html"><span class="koboSpan" id="kobo.1.3">Dedication</span></a></div>

  <div class="cfmh"><a href="abhi_9781610390408_oeb_frw_r1.html"><span class="koboSpan" id="kobo.1.4">Foreword</span></a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c01_r1.html"><span class="koboSpan" id="kobo.1.5">Chapter 1 - Think Again, Again</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c01_r1.html#h1"><span class="koboSpan" id="kobo.1.6">TRAPPED IN POVERTY?</span></a></div>

  <div>&#160;<br/></div>

  <div class="cpt"><a href="abhi_9781610390408_oeb_p01_r1.html"><span class="koboSpan" id="kobo.1.7">PART I - Private Lives</span></a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c02_r1.html"><span class="koboSpan" id="kobo.1.8">Chapter 2 -  A Billion Hungry People?</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c02_r1.html#h1"><span class="koboSpan" id="kobo.1.9">ARE THERE REALLY A BILLION HUNGRY PEOPLE?</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c02_r1.html#h2"><span class="koboSpan" id="kobo.1.10">ARE THE POOR REALLY EATING WELL, AND EATING ENOUGH?</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c02_r1.html#h3"><span class="koboSpan" id="kobo.1.11">WHY DO THE POOR EAT SO LITTLE?</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c02_r1.html#h4"><span class="koboSpan" id="kobo.1.12">SO IS THERE REALLY A NUTRITION-BASED POVERTY TRAP?</span></a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c03_r1.html"><span class="koboSpan" id="kobo.1.13">Chapter 3 -  Low-Hanging Fruit for Better (Global) Health?</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c03_r1.html#h1"><span class="koboSpan" id="kobo.1.14">THE HEALTH TRAP</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c03_r1.html#h2"><span class="koboSpan" id="kobo.1.15">WHY AREN’T THESE TECHNOLOGIES USED MORE?</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c03_r1.html#h3"><span class="koboSpan" id="kobo.1.16">UNDERSTANDING HEALTH-SEEKING BEHAVIOR</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c03_r1.html#h4"><span class="koboSpan" id="kobo.1.17">THE VIEW FROM OUR COUCH</span></a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c04_r1.html"><span class="koboSpan" id="kobo.1.18">Chapter 4 - Top of the Class</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c04_r1.html#h1"><span class="koboSpan" id="kobo.1.19">SUPPLY-DEMAND WARS</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c04_r1.html#h2"><span class="koboSpan" id="kobo.1.20">THE CURSE OF EXPECTATIONS</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c04_r1.html#h3"><span class="koboSpan" id="kobo.1.21">WHY SCHOOLS FAIL</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c04_r1.html#h4"><span class="koboSpan" id="kobo.1.22">REENGINEERING EDUCATION</span></a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c05_r1.html"><span class="koboSpan" id="kobo.1.23">Chapter 5 - Pak Sudarno’s Big Family</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c05_r1.html#h1"><span class="koboSpan" id="kobo.1.24">WHAT IS WRONG WITH LARGE FAMILIES?</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c05_r1.html#h2"><span class="koboSpan" id="kobo.1.25">DO THE POOR CONTROL THEIR FERTILITY DECISIONS?</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c05_r1.html#h3"><span class="koboSpan" id="kobo.1.26">CHILDREN AS FINANCIAL INSTRUMENTS</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c05_r1.html#h4"><span class="koboSpan" id="kobo.1.27">THE FAMILY</span></a></div>

  <div>&#160;<br/></div>

  <div class="cpt"><a href="abhi_9781610390408_oeb_p02_r1.html"><span class="koboSpan" id="kobo.1.28">PART II - Institutions</span></a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c06_r1.html"><span class="koboSpan" id="kobo.1.29">Chapter 6 - Barefoot Hedge-Fund Managers</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c06_r1.html#h1"><span class="koboSpan" id="kobo.1.30">THE HAZARDS OF BEING POOR</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c06_r1.html#h2"><span class="koboSpan" id="kobo.1.31">THE HEDGE</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c06_r1.html#h3"><span class="koboSpan" id="kobo.1.32">WHERE ARE THE INSURANCE COMPANIES FOR THE POOR?</span></a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c07_r1.html"><span class="koboSpan" id="kobo.1.33">Chapter 7 - The Men from Kabul and the Eunuchs of India: The (Not So) Simple  …</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c07_r1.html#h1"><span class="koboSpan" id="kobo.1.34">LENDING TO THE POOR</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c07_r1.html#h2"><span class="koboSpan" id="kobo.1.35">MICRO INSIGHTS FOR A MACRO PROGRAM</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c07_r1.html#h3"><span class="koboSpan" id="kobo.1.36">DOES MICROCREDIT WORK?</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c07_r1.html#h4"><span class="koboSpan" id="kobo.1.37">THE LIMITS OF MICROCREDIT</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c07_r1.html#h5"><span class="koboSpan" id="kobo.1.38">HOW CAN LARGER FIRMS BE FINANCED?</span></a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c08_r1.html"><span class="koboSpan" id="kobo.1.39">Chapter 8 -  Saving Brick by Brick</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c08_r1.html#h1"><span class="koboSpan" id="kobo.1.40">WHY THE POOR DON’T SAVE MORE</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c08_r1.html#h2"><span class="koboSpan" id="kobo.1.41">THE PSYCHOLOGY OF SAVINGS</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c08_r1.html#h3"><span class="koboSpan" id="kobo.1.42">POVERTY AND THE LOGIC OF SELF-CONTROL</span></a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c09_r1.html"><span class="koboSpan" id="kobo.1.43">Chapter 9 -  Reluctant Entrepreneurs</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c09_r1.html#h1"><span class="koboSpan" id="kobo.1.44">CAPITALISTS WITHOUT CAPITAL</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c09_r1.html#h2"><span class="koboSpan" id="kobo.1.45">THE BUSINESSES OF THE POOR</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c09_r1.html#h3"><span class="koboSpan" id="kobo.1.46">GOOD JOBS</span></a></div>

  <div class="cct"><a href="abhi_9781610390408_oeb_c10_r1.html"><span class="koboSpan" id="kobo.1.47">Chapter 10 - Policies, Politics</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c10_r1.html#h1"><span class="koboSpan" id="kobo.1.48">POLITICAL ECONOMY</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c10_r1.html#h2"><span class="koboSpan" id="kobo.1.49">CHANGES AT THE MARGIN</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c10_r1.html#h3"><span class="koboSpan" id="kobo.1.50">DECENTRALIZATION AND DEMOCRACY IN PRACTICE</span></a></div>

  <div class="ch1"><a href="abhi_9781610390408_oeb_c10_r1.html#h4"><span class="koboSpan" id="kobo.1.51">AGAINST POLITICAL ECONOMY</span></a></div>

  <div>&#160;<br/></div>

  <div class="cbmh"><a href="abhi_9781610390408_oeb_bm1_r1.html"><span class="koboSpan" id="kobo.1.52">In Place of a Sweeping Conclusion</span></a></div>

  <div class="cbmh"><a href="abhi_9781610390408_oeb_ack_r1.html"><span class="koboSpan" id="kobo.1.53">Acknowledgements</span></a></div>

  <div class="cbmh"><a href="abhi_9781610390408_oeb_nts_r1.html"><span class="koboSpan" id="kobo.1.54">Notes</span></a></div>

  <div class="cbmh"><a href="abhi_9781610390408_oeb_in1_r1.html"><span class="koboSpan" id="kobo.1.55">Index</span></a></div>

  <div class="cbmh"><a href="abhi_9781610390408_oeb_cop_r1.html"><span class="koboSpan" id="kobo.1.56">Copyright Page</span></a></div>

</div></div></body></html>
pgaskin commented 4 years ago

Does it pass epubcheck?

bangedorrunt commented 4 years ago

i double checked it again, yes, the files passed epubcheck. as i mentioned above, the issue only happened with .kepub. i tested some .epub files on two kobo devices and calibre viewer, they all worked as expected.

when i came back to .kepub files, they all jumped to first page (or page cover).

also pls note that, not only toc but footnote links are affected as well.

i'm clueless :(

pgaskin commented 4 years ago

I would have to see the full file, as there's nothing obviously wrong with the TOC. You can email it to me at my email address on my GitHub profile.

bangedorrunt commented 4 years ago

many thanks @geek1011, it was really my fault. i mistook check book for run epubcheck in calibre. i found out the latter just a moment before i was about to send you the book for testing.

running epubcheck gave me some errors that i could fix by simply removing some invalid tags, though it had nothing to do with the table of content. by doing so, i could use the inline table of content as expected.