markdown-toc icon indicating copy to clipboard operation
markdown-toc copied to clipboard

wrong output and slug generated (using GFM as reference) when title contains a link

Open trusktr opened this issue 4 years ago • 0 comments

Input:

## Usage with [`@lume/element`](https://github.com/lume/element)

Expected output:

  * [Usage with [`@lume/element`](https://github.com/lume/element)](#usage-with-lumeelement)

Actual output:

  * [Usage with [`@lume/element`](https://github.com/lume/element)](#usage-with-lumeelementhttpsgithubcomlumeelement)

The slug does not have only the part that would be visible to the user reading the file. The slug should be based on the visible test (user doesn't see the URL).

Also maybe the link needs to be stripped, because it results in this:

trusktr avatar Feb 03 '21 16:02 trusktr