Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Absolute depth change is ok.

It's only depth *increase* of greater than 1 that's bad.
  • Loading branch information...
commit 6624e840101d00d77f6c28a62cf4f678b4f8fe7b 1 parent 5f288c8
@isaacs isaacs authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  tools/doc/html.js
  2. +1 −1  tools/doc/json.js
View
2  tools/doc/html.js
@@ -58,7 +58,7 @@ function buildToc(lexed, filename, cb) {
var depth = 0;
lexed.forEach(function(tok) {
if (tok.type !== 'heading') return;
- if (Math.abs(tok.depth - depth) > 1) {
+ if (tok.depth - depth > 1) {
return cb(new Error('Inappropriate heading level\n' +
JSON.stringify(tok)));
}
View
2  tools/doc/json.js
@@ -30,7 +30,7 @@ function doJSON(input, filename, cb) {
if (type === 'heading' &&
!text.trim().toLowerCase().match(/^example/)) {
- if (Math.abs(tok.depth - depth) > 1) {
+ if (tok.depth - depth > 1) {
return cb(new Error('Inappropriate heading level\n'+
JSON.stringify(tok)));
}

0 comments on commit 6624e84

Please sign in to comment.
Something went wrong with that request. Please try again.