Skip to content

Commit 6624e84

Browse files
committed
Absolute depth change is ok.
It's only depth *increase* of greater than 1 that's bad.
1 parent 5f288c8 commit 6624e84

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tools/doc/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function buildToc(lexed, filename, cb) {
5858
var depth = 0;
5959
lexed.forEach(function(tok) {
6060
if (tok.type !== 'heading') return;
61-
if (Math.abs(tok.depth - depth) > 1) {
61+
if (tok.depth - depth > 1) {
6262
return cb(new Error('Inappropriate heading level\n' +
6363
JSON.stringify(tok)));
6464
}

tools/doc/json.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function doJSON(input, filename, cb) {
3030

3131
if (type === 'heading' &&
3232
!text.trim().toLowerCase().match(/^example/)) {
33-
if (Math.abs(tok.depth - depth) > 1) {
33+
if (tok.depth - depth > 1) {
3434
return cb(new Error('Inappropriate heading level\n'+
3535
JSON.stringify(tok)));
3636
}

0 commit comments

Comments
 (0)