Skip to content
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

GFM and CommonMark compatibility #4

Closed
GULPF opened this issue Oct 22, 2018 · 4 comments
Closed

GFM and CommonMark compatibility #4

GULPF opened this issue Oct 22, 2018 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@GULPF
Copy link

GULPF commented Oct 22, 2018

The roadmap mentions correctness, but doesn't further explain what that means. There is no consensus on what correct handling of markdown is, see for example Babelmark which compares the output of 20 different markdown implementations. Here's just one example where the issue becomes obvious.

Have you considered making this an implementation of the GFM spec? GFM is an extension of the CommonMark spec made by GitHub, which includes support for tables and several other non-standard markdown features. By making it possible to enable/disable the extensions in the API, it would also be an implementation of CommonMark itself.

@soasme
Copy link
Owner

soasme commented Oct 22, 2018

@GULPF Thanks for the proposal. I've added the GFM implementation as the top priority as stated in README.md. In the next few days, I'll try to let the codebase pass the GFM test cases. <3

@soasme soasme added the enhancement New feature or request label Oct 23, 2018
@soasme soasme self-assigned this Oct 23, 2018
@soasme
Copy link
Owner

soasme commented Oct 25, 2018

The corresponding work is in gfm-dev branch. So far, 201/603 of given gfm examples passed. I'll merge the code constantly into the master branch. During the transition, some gfm features are not rendered but more close to marked. I'll keep the confusions as less as possible.

@soasme
Copy link
Owner

soasme commented Sep 7, 2019

As of now (v0.7.1), nim-markdown has passed all 649 cases defined in commonmark v0.29 spec. Certain GFM extensions have been implemented, such as HTML table, strikethrough. I'll polish the code and work on the other GFM extensions in the next few weeks, such as task list items, disallowed raw HTML, etc.

You can now get a commonmark-compatible markdown parser by calling:

let html = markdown(md)
# or
let html = markdown(md, config=initCommonmarkConfig())

or, get a partially-implemented gfm parser by calling:

let html  = markdown(md, config=initGfmConfig())

@soasme
Copy link
Owner

soasme commented Sep 7, 2019

I'll close out this issue. The implementations for the rest of GFM extensions can be tracked individually in #32, #33, #34.

@soasme soasme closed this as completed Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants