Fixed toc extension to work without wmd-title class

This commit is contained in:
benweet 2013-11-19 00:59:58 +00:00
parent f799dea7bb
commit bacc1a7408
3 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
CACHE MANIFEST CACHE MANIFEST
#Date Tue Nov 19 2013 00:39:24 #Date Tue Nov 19 2013 00:58:39
CACHE: CACHE:
res/worker.js res/worker.js

View File

@ -20656,7 +20656,7 @@ function() {
return i[r] = !0, e.id = r, r; return i[r] = !0, e.id = r, r;
} }
var i = {}, o = []; var i = {}, o = [];
return t.each(u.querySelectorAll(".preview-content > .wmd-title"), function(t) { return t.each(u.querySelectorAll("h1, h2, h3, h4, h5, h6"), function(t) {
o.push(new s(t.tagName, e(t), t.textContent)); o.push(new s(t.tagName, e(t), t.textContent));
}), o = a(o), '<div class="toc">\n<ul>\n' + o.join("") + "</ul>\n</div>\n"; }), o = a(o), '<div class="toc">\n<ul>\n' + o.join("") + "</ul>\n</div>\n";
} }

View File

@ -107,7 +107,7 @@ define([
} }
var elementList = []; var elementList = [];
_.each(previewContentsElt.querySelectorAll('.preview-content > .wmd-title'), function(elt) { _.each(previewContentsElt.querySelectorAll('h1, h2, h3, h4, h5, h6'), function(elt) {
elementList.push(new TocElement(elt.tagName, createAnchor(elt), elt.textContent)); elementList.push(new TocElement(elt.tagName, createAnchor(elt), elt.textContent));
}); });
elementList = groupTags(elementList); elementList = groupTags(elementList);