-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Comments
Sigh |
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). |
No, it doesn't support everything of GFM. Example: go make some task lists with it. |
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. |
@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. |
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. |
@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. |
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.
What do you mean? |
Thanks for the clarification. I think you are 100% correct that line breaks are no longer part of GFM as per this:
Closing this issue.
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. |
CommonMark spec example [erusev#170](http://spec.commonmark.org/0.26/#example-170) has a empty HTML result.
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.
The text was updated successfully, but these errors were encountered: