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 not enabled by default #170

Closed
clphillips opened this issue May 5, 2014 · 11 comments
Closed

GFM not enabled by default #170

clphillips opened this issue May 5, 2014 · 11 comments

Comments

@clphillips
Copy link

Apparently, most of the library is GFM compliant, with the exception of line breaks. Why? This library claims to be GFM so it should be, by default, GFM. If someone wants original MD line breaks that should require invoking Parsedown::setBreaksEnabled() (obviously not named the same as that would introduce all kinds of issues for existing users).

See related #169.

@kminchev
Copy link

kminchev commented May 5, 2014

Sigh
It's not an exception. It supports GFM linebreaks, just enable them. That doesn't make it incompliant. This 'library' doesn't claims to be GFM (to my understanding), it claims to support features of GFM.
If GFM linebreaks are enabled by default, then someone else like you will complain why MD linebreaks aren't enabled by default, since this 'library' is MD parser.
You can't make everybody happy. That's why there are options to toggle things on and off. It's not like enabling GFM linebreaks requires you to recompile it or something.

@clphillips
Copy link
Author

The library is a GFM parser. It handles EVERYTHING just like GFM, not at all like vanilla MD.

<?php
include "Parsedown.php";

$parser = new Parsedown();

$text = "wow_great_stuff";
var_dump($parser->text($text));

$text = "~~Mistaken text.~~";
var_dump($parser->text($text));
?>

Let's not pretend this is a vanilla MD parser with GFM add-ons. It's a GFM parser, so it should act line one out of the box (wrt line breaks, as it does with everything else).

@kminchev
Copy link

kminchev commented May 5, 2014

No, it doesn't support everything of GFM. Example: go make some task lists with it.

@clphillips
Copy link
Author

@kminchev Now you're just being silly. Show me where task lists are mentioned in the GFM spec.

I proved you wrong, just accept it. :)

@scottchiefbaker
Copy link

GFM also supports Emoji which Parsedown doesn't support yet. It may in the future, I know it was mentioned in another bug.

If emoji is supported it should be disabled by default, and enabled with an option.

@clphillips
Copy link
Author

@kminchev :) That's github specific functionality. Next you'll be telling me this isn't GFM because it doesn't support linking to github issues:

include "Parsedown.php";

$parser = new Parsedown();

$text = "Fixes #170";
echo $parser->text($text);

Let's be realistic.

@kminchev
Copy link

kminchev commented May 5, 2014

Perhaps you didn't read the first sentence of the blog post I linked. Oh, and just because someone forgot to add task lists, email obfuscation and emoji to 'the GFM spec' doesn't mean it's not there.

@clphillips
Copy link
Author

@scottchiefbaker Github also supports @ linking people, which doesn't make much sense outside the context of github (just like task lists).

This isn't about what github supports in their parser, this is about GFM with respect to how it differs from vanilla MD. Specifically in regards to line breaks.

@erusev
Copy link
Owner

erusev commented May 5, 2014

This library claims to be GFM so it should be, by default, GFM.

I consider the document at https://help.github.com/articles/github-flavored-markdown to be the specification of GFM. It used to mention line breaks. It no longer does. That's the reason it is an option and off by default.

I hope this makes sense.

obviously not named the same as that would introduce all kinds of issues for existing users

What do you mean?

@clphillips
Copy link
Author

I consider the document at https://help.github.com/articles/github-flavored-markdown to be the specification of GFM. It used to mention line breaks. It no longer does. That's the reason it is an option and off by default.

Thanks for the clarification. I think you are 100% correct that line breaks are no longer part of GFM as per this:

written using GitHub Flavored Markdown along with some additional features to make writing content on GitHub easy.

Closing this issue.

obviously not named the same as that would introduce all kinds of issues for existing users

What do you mean?

I meant, if github line breaks were to be the default behavior, this would mean that there would need to be an option to enable vanilla MD line breaks. That would probably work something like:

$parser = new Parsedown();
$parser->setBreaksAfterSpaceEnabled();

You'd essentially want to rename the method so as not to conflict with setBreaksEnabled() during the deprecated/transition period. But that's a moot point.

PhrozenByte added a commit to PhrozenByte/parsedown that referenced this issue Oct 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants