Skip to content

Remote file: first heading is replaced with GitHub page HTML #166

Description

@ekalinin

Steps

./gh-md-toc https://github.com/ekalinin/github-markdown-toc/blob/master/README.md

Expected

* [gh-md-toc](#gh-md-toc)
* [Table of contents](#table-of-contents)
...

Actual

The first entry contains GitHub page markup instead of the heading:

   * [<button data-component="Button" type="button" aria-label="Expand file tree" ...
* [Table of contents](#table-of-contents)
...

The line is about 30 KB long, its href points to the repository tree URL
(/<owner>/<repo>/tree/<sha>) instead of the heading anchor, and it is indented
as a second-level entry. The other entries are correct.

Reproduced with gh-md-toc 0.10.0. The same happens for
https://github.com/ekalinin/sitemap.js/blob/6bc3eb12c898c1037a35a11b2eb24ababdeb3580/README.md
(the URL from the commented-out "TOC for remote README.md" test).
Wiki pages, e.g. https://github.com/ekalinin/nodeenv/wiki/Who-Uses-Nodeenv, are not affected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions