-
Notifications
You must be signed in to change notification settings - Fork 93
Closed
Labels
Description
Describe the bug
I downloaded the Windows binary release to try out. It seems to succeed in converting the Markdown to HTML, but instead of printing a Markdown TOC, it prints a list of what appear to be HTTP response headers from GitHub.
To Reproduce
- Download and extract the Windows binary (I also had to give it an .exe extension)
- Run it on a local markdown file in the same directory (doesn't seem to be able to handle drive letters in paths, but relative paths are OK)
Example command:
gh-md-toc.exe Home.md --debug
I also tried using the --token
argument with my GitHub token, did not see any difference.
The file being used does have headings in the form of #
, ##
and so on.
Expected behavior
Markdown TOC, like the examples in the readme.
Environment (please complete the following information):
- OS: Windows 10
- Version: 1.2.0
Additional context
Here's a complete copy/paste of the command line:
gh-md-toc.exe Home.md --debug
Table of Contents
=================
2022/12/08 20:26:46 Convert2HTML: start.
2022/12/08 20:26:46 IsRemoteFile: false
2022/12/08 20:26:46 Convert2HTML: local file: Home.md
Header: X-Commonmarker-Version=0.23.6
Header: Cache-Control=public, max-age=60, s-maxage=60
Header: X-Ratelimit-Resource=core
Header: Access-Control-Expose-Headers=ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
Header: X-Content-Type-Options=nosniff
Header: X-Xss-Protection=0
Header: Content-Security-Policy=default-src 'none'
Header: Content-Type=text/html;charset=utf-8
Header: Vary=Accept
Header: X-Github-Media-Type=github.v3; format=json
Header: Access-Control-Allow-Origin=*
Header: X-Frame-Options=deny
Header: X-Github-Request-Id=<redacted>
Header: Server=GitHub.com
Header: Date=Fri, 09 Dec 2022 01:26:47 GMT
Header: Etag=<redacted>
Header: X-Github-Api-Version-Selected=2022-11-28
Header: X-Ratelimit-Reset=1670552242
Header: X-Ratelimit-Used=6
Header: Strict-Transport-Security=max-age=31536000; includeSubdomains; preload
Header: X-Ratelimit-Limit=60
Header: X-Ratelimit-Remaining=54
Header: Referrer-Policy=origin-when-cross-origin, strict-origin-when-cross-origin
2022/12/08 20:26:47 Convert2HTML: converted to html, size: 19997
2022/12/08 20:26:47 Convert2HTML: write html file: Home.md.debug.html
2022/12/08 20:26:47 Convert2HTML: done.
2022/12/08 20:26:47 GrabToc: start, html size: 19997
2022/12/08 20:26:47 GrabToc: matching ...
2022/12/08 20:26:47 GrabToc: processing groups ...
2022/12/08 20:26:47 Including starting frome level 0
2022/12/08 20:26:47 GrabToc: done.
Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc.go)
I'd rather not post the entire converted HTML but I verified that it does have <h1>
, <h2>
etc. tags.