michelf/php-markdown — pull request #171 by sorbits (2014-08-03 13:41:14+00:00)
Title: Entity encode mailto anchors

Previously the following was left unencoded: `[send feedback](mailto:feedback@example.org)`.

This commit introduces a public `Markdown::entityEncodeText` (static) function since we need to call this from an anonymous function and probably want to keep compatibility with older PHP versions (which lack closures). Though if the public function is undesired, we can drop the anonymous function and pass `array($this, «function name»)` as callback, which seems to be the current convention.

I just wanted to ensure you actually want this feature before spending further time on it.

There does seem to be some potential for factoring out link creation into a single function accepting URL, text, and optional title, this function would then check for `mailto:` URL prefix and appropriate processing of text and title as well.