markdown-toc
markdown-toc copied to clipboard
--no-firsth1 option causes "undefined" words to appear in the toc
Example without the option:
$ npx markdown-toc README.md
- [my-project](#my-project)
- [Getting started](#getting-started)
- [Usage](#usage)
* [Example](#example)
- [API](#api)
* [The `` element](#the--element)
+ [Attributes/Properties](#attributesproperties)
+ [Methods](#methods)
+ [Events](#events)
- [More Examples](#more-examples)
* [Usage with [`@lume/element`](https://github.com/lume/element)](#usage-with-lumeelementhttpsgithubcomlumeelement)
* [Usage with React](#usage-with-react)
* [Usage with React and TypeScript](#usage-with-react-and-typescript)
* [Usage with other view libs/frameworks](#usage-with-other-view-libsframeworks)
- [Development](#development)
* [Test it in the examples](#test-it-in-the-examples)
* [Test it in another project](#test-it-in-another-project)
Example with the option:
$ npx markdown-toc --no-firsth1 README.md
undefined [Getting started](#getting-started)
undefined [Usage](#usage)
- [Example](#example)
undefined [API](#api)
- [The `` element](#the--element)
* [Attributes/Properties](#attributesproperties)
* [Methods](#methods)
* [Events](#events)
undefined [More Examples](#more-examples)
- [Usage with [`@lume/element`](https://github.com/lume/element)](#usage-with-lumeelementhttpsgithubcomlumeelement)
- [Usage with React](#usage-with-react)
- [Usage with React and TypeScript](#usage-with-react-and-typescript)
- [Usage with other view libs/frameworks](#usage-with-other-view-libsframeworks)
undefined [Development](#development)
- [Test it in the examples](#test-it-in-the-examples)
- [Test it in another project](#test-it-in-another-project)
@trusktr thank you for the issue and the example. Will you also include the source README.md to help determine where the bug is occurring?
It happens only when the file contains <!-- toc -->. Sample file : README.md.txt.
Without <!-- toc --> :
mycomputer$ markdown-toc --no-firsth1 README.md
- [About](#about)
- [Requirements & installation](#requirements--installation)
* [Python package installation](#python-package-installation)
* [Installation from source](#installation-from-source)
* [Docker usage](#docker-usage)
...
With <!-- toc --> :
mycomputer$ markdown-toc --no-firsth1 README.md
undefined [Requirements & installation](#requirements--installation)
- [Python package installation](#python-package-installation)
- [Installation from source](#installation-from-source)
- [Docker usage](#docker-usage)
...
Also it's probably a duplicate of #42 and #131