suttacentral / bilara-data

Content for Bilara translation webapp.
https://bilara.suttacentral.net
28 stars 37 forks source link

bugs in epub conversion of ToC #2911

Open sujato opened 1 year ago

sujato commented 1 year ago

There are some bugs in the ToC in the EPUB which are correct in the HTML.

HTML:

<section epub:type="toc" id="main-toc">
<nav>
<div class="main-toc-heading" epub:type="title">Contents</div>
<ul>
<li>
<a href="#foreword">Foreword</a>
</li>
<li>
<a href="#preface">Preface</a>
</li>
<li>
<a href="#introduction">Introduction</a>
</li>
<li>
<a href="#acknowledgements">Acknowledgements</a>
</li>
<li>
<a href="#pli-tv-bu-vb">Monks’ Rules and Their Analysis </a>
</li>
<li>
<a href="#pli-tv-bi-vb">Nuns’ Rules and Their Analysis </a>
</li>

EPUB:

<nav epub:type="toc" id="id" role="doc-toc">
      <h2>Theravāda Collection on Monastic Law</h2>
      <ol>
        <li>
          <a href="foreword.xhtml#foreword">Foreword</a>
        </li>
        <li>
          <a href="preface.xhtml#preface">Preface</a>
        </li>
        <li>
          <a href="introduction.xhtml#introduction">Introduction</a>
        </li>
        <li>
          <a href="acknowledgements.xhtml#acknowledgements">Acknowledgements</a>
        </li>
        <li>
          <a href="pli-tv-bu-vb.xhtml#pli-tv-bu-vb">Monks’ Rules and Their Analysis </a>
          <ol/>
        </li>
        <li>
          <a href="pli-tv-bi-vb.xhtml#pli-tv-bi-vb">Nuns’ Rules and Their Analysis </a>
          <ol/>
        </li>

Two bugs:

ihongda commented 1 year ago

截图 2023-10-28 10-26-42

Now the ToC no longer appear alone</ol>

ihongda commented 1 year ago

At present, I have not seen any method in the ebooklib library that can modify the attributes of the nav element. Unless the code that generates navigation content is rewritten, I suggest not dealing with the issue of id="id" for the time being.