Binder levels can break auto-ToC for EPub3

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

<!DOCTYPE html>
<html xml:lang="en" lang="en" xmlns="" xmlns:epub="">
	<meta charset="utf-8"/>
	<link type="text/css" rel="stylesheet" href="css/stylesheet.css"/>

<nav epub:type="toc" id="toc">
<h2 class="title">Contentz</h2>
<p style="text-align: left"><li><a href="body.xhtml">Chapter One - Methods</a></p>
<p style="text-align: left"><li><a href="body1.xhtml">Chapter Two - General Details</a></p>
<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>




The problem is the

  • elements are wrapped in

    elements but you close the

    before you close the
  • . The

    is triggered by some compile setting…

    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

    code). I’ve tried toggling things around in that format but can’t find what triggers it… (732 KB)

    This should be fixed for 3.0.1.