pypa / readme_renderer

Safely render long_description/README files in Warehouse
Apache License 2.0
158 stars 88 forks source link

readme_renderer is failing to render multi-line code blocks in GFM Markdown #195

Closed hfaran closed 3 years ago

hfaran commented 3 years ago

I'm trying to publish a package with a perfectly valid GFM README.md (this one specifically: https://github.com/hfaran/slack-export-viewer/blob/master/README.md) but when I run readme_renderer to try and validate the file, it chokes on whatever first multi-line code block it finds with the following:

┌— hamza@AURORAONE D:\gitr\_github.com\hfaran\slack-export-viewer
├— git —→ [master]
└———→ python -m readme_renderer README.md -o README.html
<string>:43: (WARNING/2) Inline literal start-string without end-string.

I'm using the latest version (29.0). Is this happening for anyone else?

hfaran commented 3 years ago

For reference, this README published just fine for the last release of my package that I did (which was on June 8, 2020). There is possibly a regression in readme_renderer since then?

di commented 3 years ago

Can you tell us what version of cmarkgfm you have installed?

di commented 3 years ago

Sorry, scratch that. The problem is that the invocation you're using only has the ability to check reStructuredText files. If you want to check markdown, I'd recommend first building your package, and then using twine check instead.

(This is also detailed in the README for this repo here: https://github.com/pypa/readme_renderer#check-description-locally)

hfaran commented 3 years ago

I see. Well, twine check is actually what I ran first and it gave me the same error. I ran readme_renderer afterwards to get more details (but it wasn't anymore specific).

twine check also told me it didn't find the content type and so defaulted to RST, which is probably why the error was the same.

The thing is, I do have the content type defined correctly (see this: https://github.com/hfaran/slack-export-viewer/blob/447971b027953a10ea60f3424d7c3247eeb7c7a8/setup.py#L28) and it shows up correctly when I open up the PKG_INFO in the built package. So the question is, why isn't twine seeing it? Is there something in the actual readme content in the PKG_INFO that's causing twine to miss it?

di commented 3 years ago

Can you share the actual distribution file that's failing twine check here?