Skip to content

Commit

Permalink
FIXED: Duplicated entries in TOC of large document. Patch submitted by
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuart Rackham committed Dec 18, 2011
1 parent bdc2525 commit e8c95de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions javascripts/asciidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ toc: function (toclevels) {
var i;
for (i = 0; i < toc.childNodes.length; i++) {
var entry = toc.childNodes[i];
if (entry.nodeName == 'div'
if (entry.nodeName.toLowerCase() == 'div'
&& entry.getAttribute("class")
&& entry.getAttribute("class").match(/^toclevel/))
tocEntriesToRemove.push(entry);
Expand Down Expand Up @@ -114,7 +114,7 @@ footnotes: function () {
var entriesToRemove = [];
for (i = 0; i < noteholder.childNodes.length; i++) {
var entry = noteholder.childNodes[i];
if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")
if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
entriesToRemove.push(entry);
}
for (i = 0; i < entriesToRemove.length; i++) {
Expand Down

0 comments on commit e8c95de

Please sign in to comment.