Skip to content

Commit

Permalink
style: fixing minor style problems
Browse files Browse the repository at this point in the history
  • Loading branch information
thlorenz committed Feb 5, 2015
1 parent b07592a commit 2e37da2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,5 @@ Use the `--maxlevel` option to limit TOC entries to headings only up to the spec

By default,

* no limit is placed on Markdown-formatted headings,
* whereas headings from embedded HTML are limited to 4 levels.
- no limit is placed on Markdown-formatted headings,
- whereas headings from embedded HTML are limited to 4 levels.
10 changes: 5 additions & 5 deletions doctoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ function printUsageAndExit(isErr) {
}

var modes = {
bitbucket: 'bitbucket.org'
, nodejs: 'nodejs.org'
, github: 'github.com'
, gitlab: 'gitlab.com'
, ghost: 'ghost.org'
bitbucket : 'bitbucket.org'
, nodejs : 'nodejs.org'
, github : 'github.com'
, gitlab : 'gitlab.com'
, ghost : 'ghost.org'
}

var mode = modes['github'];
Expand Down
10 changes: 5 additions & 5 deletions lib/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ function getUnderlinedHeaders (lines, maxHeaderLevel) {
else return null;

return !maxHeaderLevel || (rank <= maxHeaderLevel)
? {
rank : rank,
name : lines_[index - 1],
line : index - 1
? { rank : rank
, name : lines_[index - 1]
, line : index - 1
}
: null;
})
Expand Down Expand Up @@ -116,7 +115,8 @@ function getLinesToToc (lines, currentToc, info) {

exports = module.exports = function transform(content, mode, maxHeaderLevel, title) {
mode = mode || 'github.com';
var maxHeaderLevelHtml = maxHeaderLevel || 4; // only limit *HTML* headings by default
// only limit *HTML* headings by default
var maxHeaderLevelHtml = maxHeaderLevel || 4;
title = title || '**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*';

var lines = content.split('\n')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies": {
"anchor-markdown-header": "^0.5.0",
"htmlparser2": "~3.7.1",
"minimist": "^1.1.0",
"minimist": "~1.1.0",
"underscore": ">=1.3.3",
"update-section": "^0.3.0"
},
Expand Down

0 comments on commit 2e37da2

Please sign in to comment.