Binder levels can break auto-ToC for EPub3

User avatar
nontroppo
Posts: 755
Joined: Mon Mar 05, 2007 5:22 pm
Platform: Mac
Location: Airstrip One

Mon Dec 04, 2017 2:23 pm Post

Hi, if I have 3 levels in the binder, the HTML of the auto-generated contents.xhtml is invalid:

Code: Select all

<!DOCTYPE html>
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
   <meta charset="utf-8"/>
   <title>Contents</title>
   <link type="text/css" rel="stylesheet" href="css/stylesheet.css"/>
</head>
<body>

<nav epub:type="toc" id="toc">
<h2 class="title">Contentz</h2>
<ol>
<p style="text-align: left"><li><a href="body.xhtml">Chapter One - Methods</a></p>
<ol>
<p style="text-align: left"><li><a href="body1.xhtml">Chapter Two - General Details</a></p>
<ol>
<p style="text-align: left"><li><a href="body2.xhtml">Chapter Three - Analysis—1</a></li></p>
<p style="text-align: left"><li><a href="body3.xhtml">Chapter Four - Analysis—2</a></li></p>
<p style="text-align: left"><li><a href="body4.xhtml">Chapter Five - Analysis—3</a></li></p>
</ol>

<p></li></p>
</ol>

<p></li></p>
</ol>
</nav>

</body>
</html>


The problem is the <li> elements are wrapped in <p> elements but you close the </p> before you close the </li>. The <p style="text-align: left"> is triggered by some compile setting...
Last edited by nontroppo on Tue Dec 05, 2017 2:44 am, edited 2 times in total.

User avatar
KB
Site Admin
Posts: 19190
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Mon Dec 04, 2017 4:03 pm Post

I can't reproduce this. Can you please attach a sample project showing the issue?
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

User avatar
nontroppo
Posts: 755
Joined: Mon Mar 05, 2007 5:22 pm
Platform: Mac
Location: Airstrip One

Tue Dec 05, 2017 2:39 am Post

KB wrote:I can't reproduce this. Can you please attach a sample project showing the issue?


Attached. This seems to be triggered by some setting in the Project Compile format "Ebook Code" (which was duplicated from the standard "Ebook" format, which doesn't trigger this rogue <p> code). I've tried toggling things around in that format but can't find what triggers it...

Blank3.scriv.zip
(731.89 KiB) Downloaded 1 time