joeyespo / grip

Preview GitHub README.md files locally before committing them.
MIT License
6.45k stars 423 forks source link

Funky headings #244

Closed meyer closed 6 years ago

meyer commented 6 years ago

I think something in Githubโ€™s API must have changed very recently. Sometime in the past day or so my headings started to look like this:

screenshot 2017-09-22 19 45 52

reviewher commented 6 years ago

This seems to happen to all of the headings # through ######:

screen shot 2017-09-22 at 22 54 27
joeyespo commented 6 years ago

Yikes! I just saw this too. Thanks for opening the issue, @meyer!

Yeah, looks like an API bug leaked through:

$ curl https://api.github.com/markdown -d '{ "text": "# testing" }'
<h1>
<a id="user-content-testing" class="anchor" href="#testing" aria-hidden="true"><span>{:"aria-hidden"=&gt;"true", :class=&gt;"octicon octicon-link"}</span></a>testing</h1>

I just contacted GitHub's API support about it.

It's pretty annoying though, so if they don't respond or say they can't fix it quickly, I'll have time tomorrow to release a short-term workaround.

joeyespo commented 6 years ago

Alright. I haven't heard anything back yet. (It's the weekend after all.) I do think this is annoying enough to patch in the meantime, so here's a fix #245.

It's quite hacky (if you have a README that contains <span>{:"aria-hidden"=&gt;"true", :class=&gt;"octicon octicon-link"}</span>, it'll be outright replaced with <span class="octicon octicon-link"></span>), but gets the job done. As such, I made a note to remove this once GitHub addresses it.

Since I've fallen behind, this release also includes several other fixes that were just waiting on me for a summary and PyPI upload.

Thanks for your patience, all ๐Ÿ˜ƒ

reviewher commented 6 years ago

@joeyespo thanks a lot for your great effort! can confirm that grip 4.4.0 does not show the "funky headings"

foxdonut commented 6 years ago

@joeyespo you are a star! ๐ŸŒŸ thank you for fixing this so quickly, much appreciated!

joeyespo commented 6 years ago

Update

GitHub responded with this:

Just wanted to let you know that the team deployed some changes which should have fixed this problem. If you can still reproduce this โ€” please let us know.

This was sent last Monday (Sept 25), and I can confirm that it works now. (Thanks for the quick official fix, GitHub!) I'll remove the workaround in the next release ๐ŸŽ‰

meyer commented 6 years ago

@joeyespo rad, thanks! ๐Ÿ’ƒ ๐Ÿ’ƒ ๐Ÿ’ƒ