Open gstein opened 7 years ago
I don't understand what you mean by py-gfm requiring 4 space indents. Are you speaking about nested lists?
By the way, thanks for pointing out the formal spec of GFM. Their input/output examples would constitue very useful test vectors. I'll look into it for integration into this project.
Ah, sorry I wasn't clear. Yes, nested lists.
I have some markdown that looks like:
Foo
Note that there are (3) spaces before the asterisk, and GitHub properly creates a nested list. The lists do not nest properly when using py-gfm. I need to add a fourth space.
Thanks for the clarification. Will look into it.
A solution approach is suggested in https://github.com/mkdocs/mkdocs/issues/545#issuecomment-322649208
The comment further down is interesting too -
@PegasusWang Solved. Add "mdx_truly_sane_lists" to you requirements.txt or
pip install mdx_truly_sane_lists
.Then edit your mkdocs.yml like this:
markdown_extensions: - mdx_truly_sane_lists
I can confirm py-gfm behavior does not match cmark-gfm but fixing it would be a pain. Even mdx_truly_sane_lists
does not correctly handle scenarios like
* foo
* bar
1. numbered
I did not attempt to fix it for 1.0.0. I think this level of conformance with GFM should rather be implemented through cmark-gfm bindings such as cmarkgfm.
In GFM, it is possible to create a list using 2 or 3 spaces before the '*' bullet indicator. But the Python markdown + py-gfm requires 4 space indents.
GFM spec on indent is at https://github.github.com/gfm/#list-items