pypa / readme_renderer

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

Add support for GFM task list items #202

Closed jboarman closed 2 years ago

jboarman commented 3 years ago

This PR is designed to add support for TODO lists that are provided by Github Flavored Markdown.

The GFM renderer already provides this support. However, the clean operation was filtering out the resulting rendered HTML input tags.

To safely add this support, a disabled attribute is forced to be added to any rendered HTML input tags.

Now, TODO list items are properly rendered from the output of cmarkgfm.github_flavored_markdown_to_html.

Example GFM task list that can now be rendered from a README:

McSinyx commented 3 years ago

cmarkgfm 0.6.0 has been released earlier this month. Could you check for the compatibility while you're working on this PR?

jboarman commented 3 years ago

Thanks @McSinyx for mentioning the updated cmarkgfm release.

The latest cmarkgfm release makes an adjustment to how code blocks are rendered by removing CSS class assignments and favoring a lang attribute instead. The language-oriented CSS classes do not currently seem to be in use by PyPI, so this change should not have any impact.

McSinyx commented 3 years ago

I noticed this because readme-renderer is pinning cmarkgfm by its the minor version and I'm packaging downstream with a single-versioning policy so I could not upgrade cmarkgfm with the current readme-renderer. Could you try to relax the specifier?

jboarman commented 3 years ago

Sorry to hear about the issue you are encountering @McSinyx. It sounds like this needs to be addressed in a separate PR. Can you issue that PR?

mondeja commented 2 years ago

This has been added in #217