Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugs in epub conversion of ToC #2911

Open
sujato opened this issue Oct 20, 2023 · 2 comments
Open

bugs in epub conversion of ToC #2911

sujato opened this issue Oct 20, 2023 · 2 comments
Assignees

Comments

@sujato
Copy link
Contributor

sujato commented Oct 20, 2023

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:

  • EPUB has invalid <ol/> tags inserted for no reason.
  • EPUB has id="id", it should be the same as the HTML, id="main-toc"
@ihongda
Copy link
Contributor

ihongda commented Oct 28, 2023

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

Now the ToC no longer appear alone</ol>

@ihongda
Copy link
Contributor

ihongda commented Oct 30, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants