To add to this discussion of the "20 lines" setting I ran the following test and it nicely used the fragment when it built the toc.ncx
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<!-- this is a comment
-->
<h1 id="huh">This is a heading</h1>
<p> </p>
</body>
</html>
So if we make that a "setting" then changing that setting to 2, would surely make it easy to add a workaround by just adding a comment or even just a blank line after body to control things.