Skip to content

Commit

Permalink
Merge pull request #421 from gkellogg/feature/notoc
Browse files Browse the repository at this point in the history
Feature/notoc
  • Loading branch information
darobin committed Apr 2, 2015
2 parents 8a1dc72 + bc17c9c commit 85ea816
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/core/structure.js
Expand Up @@ -29,8 +29,9 @@ define(
for (var i = 0; i < $secs.length; i++) {
var $sec = $($secs[i], doc)
, isIntro = $sec.hasClass("introductory")
, noToc = $sec.hasClass("notoc")
;
if (!$sec.children().length) continue;
if (!$sec.children().length || noToc) continue;
var h = $sec.children()[0]
, ln = h.localName.toLowerCase();
if (ln !== "h2" && ln !== "h3" && ln !== "h4" && ln !== "h5" && ln !== "h6") continue;
Expand Down
1 change: 1 addition & 0 deletions tests/spec/core/structure-spec.js
Expand Up @@ -8,6 +8,7 @@ describe("Core - Structure", function () {
, body = "<section class='introductory'><h2>INTRO</h2></section>" +
"<section><h2>ONE</h2><section><h2>TWO</h2><section><h2>THREE</h2><section><h2>FOUR</h2>" +
"<section><h2>FIVE</h2><section><h2>SIX</h2></section></section></section></section></section></section>" +
"<section class='notoc'><h2>Not in TOC</h2></section>" +
"<section class='appendix'><h2>ONE</h2><section><h2>TWO</h2><section><h2>THREE</h2><section>" +
"<h2>FOUR</h2><section><h2>FIVE</h2><section><h2>SIX</h2><p>[[DAHUT]]</p><p>[[!HTML5]]</p></section></section></section>" +
"</section></section></section>"
Expand Down

0 comments on commit 85ea816

Please sign in to comment.