Skip to content

Commit

Permalink
fix SotD detection after the 2016 TR design
Browse files Browse the repository at this point in the history
Fix #290
  • Loading branch information
deniak committed Feb 29, 2016
1 parent 812095a commit b7a9d7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lib/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ Specberus.prototype.getSotDSection = function () {
, $ = this.$
, $div = $("<div></div>")
, self = this
, $nav = $("nav#toc")
;

$("h2").each(function () {
var $h2 = $(this);
if ($startH2) {
Expand All @@ -211,7 +213,7 @@ Specberus.prototype.getSotDSection = function () {
return;
}
if (!started) return;
if ($endH2[0] === this) return false;
if ($endH2[0] === this || $nav[0] === this) return false;
$div.append($(this).clone());
});
this.sotdSection = $div.children();
Expand Down Expand Up @@ -269,4 +271,3 @@ Specberus.prototype.transition = function (options) {
}

exports.Specberus = Specberus;

6 changes: 3 additions & 3 deletions test/docs/headers/simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ <h2>Status of This Document</h2>
</p>
<nav id="toc">
<h2>Table of Contents</h2>
<ul>
<li>Nothing</li>
</ul>
</nav>
<ul>
<li>Nothing</li>
</ul>
</body>
</html>

0 comments on commit b7a9d7e

Please sign in to comment.