retext-project / retext

ReText: Simple but powerful editor for Markdown and reStructuredText
GNU General Public License v2.0
1.88k stars 196 forks source link

Support CommonMark syntax #253

Open xgouchet opened 7 years ago

xgouchet commented 7 years ago

Currently ReText gives the option to use Markdown, Textile and reStructured Text. It would be great to be compliant with CommonMark (which is a kind of standardized version of Markdown)

mitya57 commented 7 years ago

Out of curiosity: what the the syntax features that are present in CommonMark that you miss with the current implementation? I am quite sure there are Python-Markdown extensions that implement the syntax you need.

That said, I can add the CommonMark markup, but I am not going to reassign the standard file extensions (.mkd, .md, .markdown) to it, so all current files will still load using Python-Markdown.

xgouchet commented 7 years ago

It's not so much mssing syntax feature, rather than having a standard syntax across several systems.

There are lots of different markdown flavor, based on website and parsers, and CommonMark actually have a spec on how to write syntax.

I understand the problem with the file extension, maybe you could add a user preference to choose between python markdown / common mark ?

keesse commented 7 years ago

I agree with xgouchet, that would be nice, a lot of other applications also support both. E.g. a '\' instead of ' ' at the end of a line is more visable (allthough ReText prints grey spaces, not all other editors do).

lofidevops commented 6 years ago

Some additional comments (just putting these links here for reference):

matkoniecz commented 3 years ago

Out of curiosity: what the the syntax features that are present in CommonMark that you miss with the current implementation? I am quite sure there are Python-Markdown extensions that implement the syntax you need.

In some cases CommonsMark and ReText gives different rendering, so I need to make changes like https://github.com/colouring-london/colouring-london/commit/b07de223b124fa18cd2373294b627c51edfb9d7f just because ReText is displaying it brokenly.

Specifically:

This repository will contain open-source code for the project which:
- stores building footprint polygons and source metadata
- allows site users to record building attribute data

is shown as list on GitHub that is using CommonsMark and not in ReText that is using MarkDown.

https://johnmacfarlane.net/babelmark2/?text=This+repository+will+contain+open-source+code+for+the+project+which%3A%0A-+stores+building+footprint+polygons+and+source+metadata%0A-+allows+site+users+to+record+building+attribute+data

screen

mitya57 commented 3 years ago

As I said earlier,

I am quite sure there are Python-Markdown extensions that implement the syntax you need.

And here is an extension for your case:

https://github.com/adamb70/mdx-breakless-lists

matkoniecz commented 3 years ago

@mitya57 How one may use them in ReText? I see no obvious way to achieve this.

mitya57 commented 3 years ago

There are multiple ways to enable extensions, as described in the wiki: https://github.com/retext-project/retext/wiki/Markdown-extensions.

And of course you need to install the extension, in this case pip3 install mdx-breakless-lists.

Screenshot