lib/toc.js
function (header, prevToken) {
        var options = this.options;

        if (header.depth > options.maxDepth) return;

        var headerText = utils.getHeader(header.text, prevToken);

        if (!headerText) return;

        var anchor = this._getAnchor(header.text, prevToken),
            indent = utils.getIndent(this._usedHeaders, header.depth);

        this._usedHeaders.unshift({
            depth: header.depth,
            indent: indent
        });

        this.data += indent + options.bullet + ' [' + headerText.replace(/\\/g, '\\\\') + '](#' + anchor + ')' + EOL;
    }
function (header, prevToken) {
        var options = this.options;

        if (header.depth > options.maxDepth) return;

        var headerText = utils.getHeader(header.text, prevToken);

        if (!headerText) return;

        var anchor = this._getAnchor(header.text, prevToken),
            indent = utils.getIndent(this._usedHeaders, header.depth);

        this._usedHeaders.unshift({
            depth: header.depth,
            indent: indent
        });

        this.data += indent + options.bullet + ' [' + headerText.replace(/\\/g, '\\\\') + '](#' + anchor + ')' + EOL;
    }
function ( header , prevToken ) { var options = this . options ; if ( header . depth > options . maxDepth ) return ; var headerText = utils . getHeader ( header . text , prevToken ) ; if ( ! headerText ) return ; var anchor = this . _getAnchor ( header . text , prevToken ) , indent = utils . getIndent ( this . _usedHeaders , header . depth ) ; this . _usedHeaders . unshift ( { depth : header . depth , indent : indent } ) ; this . data += indent + options . bullet + ' [' + headerText . replace ( / \\ / g , '\\\\' ) + '](#' + anchor + ')' + EOL ; }
Adds a TOC elemet
@param {Object} [header]
@param {Number} [header.depth]
@param {String} [header.text]
@returns {undefined}
@public
Adds a TOC elemet