-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for GitHub-flavored Markdown #67
Conversation
This uses the [cmarkgfm](https://pypi.org/project/cmarkgfm/) package to render the "gfm" variant of Markdown. It also preferentially uses cmarkgfm for CommonMark as it is CommonMark compliant (and fast). Notes: * The cmarkgfm library is currently an *extra* dependency (``readme_renderer[gfm]``) mostly because I don't yet have wheels for cmarkgfm. * I added a ton of fixtures for gfm based on GitHub's [own spec](https://github.github.com/gfm/). They had to be tweaked a little because bleach changes the output very slightly (such as adding `rel="nofollow"`).
Context: pypa/packaging-problems#126 |
Given how many folks will probably want GFM over CommonMark, I wonder if we should make that the default variant. |
+1 |
Baby steps. Let's get this in first. Solid next steps after that are:
In parallel:
|
tests/test_markdown.py
Outdated
|
||
assert render(md_markup, variant=variant) == expected | ||
assert render(md_markup, variant=variant).strip() == expected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is .strip()
necessary here? Can we just add/remove newlines from the fixtures as necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. The reason I added this is because bleach
can occasionally consume the trailing newline from things- especially when it fixes broken HTML. This is mostly just affecting on particular fixture, so I can likely just do that. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 93589c7
Ah yeah, I meant to make that comment over at pypa/packaging-problems#126 instead. Moving... |
This should Just Work™, the only change to Warehouse necessary would be bumping the |
Thanks @jonparrott! I think we should probably hold off on a release until we do
|
That's totally fine. I'm trying to get wheels built now. If you know anyone who can help with Windows builds I'd love to chat. |
This uses the cmarkgfm package to render the "gfm" variant of Markdown. It also preferentially uses cmarkgfm for CommonMark as it is CommonMark compliant (and fast).
Notes:
readme_renderer[gfm]
) mostly because I don't yet have wheels for cmarkgfm.rel="nofollow"
).