torchbox/wagtail-markdown

list render

redstoneleo opened this issue · 5 comments

The following would not be rendered as a lsit

**[Usage](http://127.0.0.1:8000/cms/pages/82/edit/)**:
- First item
- Second item
- Third item
- Fourth item

However, if you add a new line below the first line, that is,

**[Usage](http://127.0.0.1:8000/cms/pages/82/edit/)**:

- First item
- Second item
- Third item
- Fourth item

it works, any way to make the first one work, I know editors like stackedit accept it.

We use https://pypi.org/project/Markdown/ under the hood. It also follows the original Markdown syntax rules.
So this may be better if the Python Markdown issue queue

Any consideration on supporting CommonMark?
As I tested , https://github.com/executablebooks/markdown-it-py is the most accurate parser.

Hey @redstoneleo,
This is unlikely as it would require a rather large refactor, and will lose support for the plugins that Python-Markdown supports (although this may be less of an issue as https://mdit-py-plugins.readthedocs.io/en/latest/ has its own list of similar plugins, at least when it comes to the ones the current parser supports out of the box)

Will close on that basis, sorry

Yes, I agree with you that it would require a lot of effort. I just found markdown-it-py is so flexible and it is worth knowing that it supports four parsers https://markdown-it-py.readthedocs.io/en/latest/using.html?highlight=image#the-parser

I've opened #119 to keep markdown-it-py as a reference.
One way forward would be to look into making the parser swappable.