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

Include Github Flavored Markdown(GFM) in core as an option #164

Closed
tivie opened this issue Jun 18, 2015 · 9 comments
Closed

Include Github Flavored Markdown(GFM) in core as an option #164

tivie opened this issue Jun 18, 2015 · 9 comments
Assignees

Comments

@tivie
Copy link
Member

tivie commented Jun 18, 2015

Introduction

Showdown tries to follow vanilla markdown (with all its quirks and perks) as much as possible but several related issues (see #96, #152, for instance) were raised requesting showdown to fully support GFM.

(See GFM differences from traditional Markdown here).

Some features of GFM are already available from within showdown:

However, other features require changing showdown's core parsers:

  • Multiple underscores in words - Markdown explicitely accepts in-word emphasis using underscores. GFM does not. To support both we would need to change the emphasis parser and add an option to enable/disable in-word emphasis.
  • URL autolinking - Markdown uses <http://www.example.com> autolink style. GFM autolinks http://www.example.com(no need to wrap in <>). A output extension might be able to take care of this, but the regex used would have to be complex to properly parse edge cases (for instance, a link inside a code block, or in a src attribute, etc...)

Options

We have 2 options to deal with these requests:

  • Make extensions more "powerful" and allow them to override the core sub-parsers
  • Include those changes directly into core and add option(s) to activate/deactivate them.

and the third option... use both.

Thoughts?

@tivie tivie self-assigned this Jun 18, 2015
@tivie
Copy link
Member Author

tivie commented Jul 7, 2015

Bumping @pdeschen @SyntaxRules

@SyntaxRules
Copy link
Member

I think Adding in the GFM features is smart, and an easy way to compete with other parser's out there.

Marked does this via on option, but i would discourage putting it as an option in Showdown. The advantage Showdown has over Marked is that it is easily extendable. I think all of these quirky features should got in a GFM plugin. This plugin could depend upon other plugins. This way someone could pick and choose which items they want in there markdown.

If we feel strongly about including GFM features, we could include them by default.

tivie added a commit that referenced this issue Jul 11, 2015
Github Flavored Markdown detects urls and mails embeded in the text without any extra markup or delimiter.
This commit adds this feature to showdown through an option called "simplifiedAutoLink".
Related to #164
@tivie
Copy link
Member Author

tivie commented Jul 11, 2015

@SyntaxRules Yeah, I agree. The only thing is that some features have to be included directly in core, since they would need to be run in a specific order, something that showdown extensions don't support.

tivie added a commit that referenced this issue Jul 11, 2015
…underscores

Github Flavored Markdown does not parse underscores in the middle of a word as emphasis/bold.
This commit adds this feature to showdown through an option called "literalMidWordUnderscores".

Related to #164
tivie added a commit that referenced this issue Jul 11, 2015
Github Flavored Markdown supports strikethrough (`<del>`) syntax using double tilde `~~` delimiters.
This commit adds this feature to showdown through an option called "strikethrough".

Related to #164
tivie added a commit that referenced this issue Jul 11, 2015
Github Flavored Markdown supports a specific table syntax. Table support was already available as an extension.
With this commit, the feature was moved to core, adding this feature to showdown through an option called "tables".

Related to #164
tivie added a commit that referenced this issue Jul 11, 2015
Github Flavored Markdown supports tasklist by `[x]` or `[ ]` after list item marker.
This commit adds this feature to showdown through an option called "tasklists".

Related to #164
@tivie tivie closed this as completed in 7e55bce Jul 12, 2015
@grofit
Copy link

grofit commented Jul 20, 2015

A bit confused by this, I see in the documentation on the front page it mentions that tables and strikethrough are valid options for a convertor, which imply that showdown supports them by default. However looking on the wiki and at this issue imply that they are actually separate addons, so are the docs wrong or is there some mix up?

@tivie
Copy link
Member Author

tivie commented Jul 20, 2015

In short:
GFM (and other syntax extras) are supported by showdown via options. Those options are disabled by default, to use them activate them via options. No extensions are needed.


I see in the documentation on the front page it mentions that tables and strikethrough are valid options for a convertor, which imply that showdown supports them by default.

Showdown supports them if you activate them via options. Else, you get vanilla markdown. Give it a try.

However looking on the wiki and at this issue imply that they are actually separate addons, so are the docs wrong or is there some mix up?

Where in the wiki? Please add a link so we can update to make things a bit more clear.

This issue might confuse people since it refers to "plugins" which isn't accurate. Extra markdown features are implemented in separate subParsers. This means they can easily be turned on/off at will. That's what SyntaxRules was talking about.

@grofit
Copy link

grofit commented Jul 20, 2015

https://github.com/showdownjs/showdown/wiki/extensions

That lists the extensions for table etc.

I did try to use the options and they didnt seem to change anything.

new showdown.Converter({
        simplifiedAutoLink: true,
        strikethrough: true,
        tables: true
    });

Then if I were to add

| *foo* | **bar** | ~~baz~~ |
|:------|:-------:|--------:|
| 100   | [a][1]  | ![b][2] |

as shown in the example, it does not get processed, it just outputs it within a p tag, unless I am doing something wrong.

@tivie
Copy link
Member Author

tivie commented Jul 20, 2015

Are you using version 1.2.0 ?

Enviado do meu iPhone

No dia 20/07/2015, às 16:22, LP [email protected] escreveu:

https://github.com/showdownjs/showdown/wiki/extensions

That lists the extensions for table etc.

I did try to use the options and they didnt seem to change anything.

new showdown.Converter({
simplifiedAutoLink: true,
strikethrough: true,
tables: true
});
Then if I were to add

foo bar baz
100 [a][1] ![b][2]

as shown in the example, it does not get processed, it just outputs it within a p tag, unless I am doing something wrong.


Reply to this email directly or view it on GitHub.

@grofit
Copy link

grofit commented Jul 20, 2015

Sorry for the afk-ness, no I am on 1.1.0, but I only got that like a week or so ago, has it already changed so much? will go get latest and see what happens.

@ifeltsweet
Copy link

I'm actually for both options, but if have to choose only one then probably the first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants