

PHP CommonMark - aleem
https://github.com/thephpleague/commonmark

======
erusev
Parsedown has also been moving towards compliance with CommonMark.

[http://parsedown.org/](http://parsedown.org/)

~~~
aleem
I haven't used Parsedown but I am glad things are moving to CommonMark -- it
will shift the focus to performance, structure and extensibility instead of
struggling with edge cases and Markdown idiosyncrasies.

PHP CommonMark's compliance is very current--CommonMark spec 0.13, Dec 15,
2014 and it will continue to keep up.

It follows the reference implementation very closely, has good support for
extensibility and the code is very well structured. It's likely to become the
de facto PHP implementation in my opinion.

------
_RPM
[https://github.com/thephpleague/commonmark/blob/master/src/U...](https://github.com/thephpleague/commonmark/blob/master/src/Util/ArrayCollection.php#L112)
What is the Point of abstracting away "empty?"

~~~
alexbilbie
I guess because you're asking a question of the object - "is this empty?"

~~~
Rygu
It already implements count() and the corresponding interface so it's possible
to write count($collection) as if you're writing $collection->count(). It's a
valid question why this type of object needs two methods for checking the same
property.

~~~
hrtyl
PHP does not have an interface for empty. count and empty are not equivalent.
empty should be called on the underlying array and not the object.

------
laacz
Is there a need for that much of abstraction in a simple markdown parser
library?

~~~
pan69
What abstraction are you specifically referring to if I my ask?

~~~
nacs
I think parent post is just referring to the number of classes in the source.

------
jrochkind1
Aha! The controversial "Standard Markdown" (is that what it used to be
called?) has been renamed to "CommonMark", hopefully avoiding the controversy.
(Controversial because Gruber didn't like them using the Markdown name in a
standardization effort).

I'm glad. I hope to see implementations continue to spread.

~~~
philstu
Here's a whole update on the general state of markdown

[https://philsturgeon.uk/markdown/2014/11/30/state-of-
markdow...](https://philsturgeon.uk/markdown/2014/11/30/state-of-markdown/)

------
aercolino
Sorry to add a critic. If you want to make your PHP classes easy to extend,
refrain from private and prefer protected. Otherwise, a developer that wants
to extend one of your classes will need to also override (i.e. copy and paste)
into her class all private members called from the members she really wants to
override.

