okfde / froide

Freedom Of Information Portal
MIT License
353 stars 86 forks source link

Markdown processor follows weird standards #432

Open krmax44 opened 3 years ago

krmax44 commented 3 years ago

compare the rendering between python-markdown: https://fragdenstaat.de/gesetz/informationszugangsgesetz-sachsen-anhalt-izg-lsa/#%C2%A73

and github: https://github.com/okfde/ifg.md/blob/main/ifgs/ifg-sachsen-anhalt.md#-3-schutz-von-besonderen-%C3%B6ffentlichen-belangen

indentation is off, causing ordered lists to have wrong indexes. also, tables are using some obscure php-md syntax instead of the more popular github-flavored one...

stefanw commented 3 years ago

Maybe we need a fancier markdown converter, one that also places anchors like gh-flavored one.

Ryuno-Ki commented 3 years ago

There's a wide range of Markdown Flavors. It looks like Python-Markdown has no extension for those out-of-the-box. However, there seem to by py-gfm as third-party extension for it. But the README warns for it since it might become orphaned soon.

stefanw commented 3 years ago

I think the best bet is to go with the CommonMark spec and the apparently up-to-date Python implementation. Doesn't seem to offer extensions though, need to check if everything you want is covered.