Trouble with parentheses in Markdown hyperlinks

Waylan Limberg waylan at
Thu Oct 18 14:12:52 EDT 2012

On Thu, Oct 18, 2012 at 1:38 PM, Andrew Pennebaker <
andrew.pennebaker at> wrote:

> Could we standardize URL-parsing regexes across Markdown implementations?

> Can we come up with a really super regex and invite the various fork

> developers and maintainers to use that regex?



There are at least 3 possible problems with this:

1) This assumes that all implementations use regex. That may
not necessarily be the case. For example, peg markdown is a peg parser.
While I'm not sure if it uses a peg grammar or regex for matching urls (I
didn't go check), why should it be required to use a regex?

2) Not all languages (perl, python, ruby, php, lua, ...) use the same regex
implementation. For instance, when developing the python implementation of
markdown, I have had to work around a few features of the perl regex
implementation that do not exist in python. Had JG been working in a
language other than perl when he first developed the markdown syntax, I
suspect a few things would be different. Some subtle features of the syntax
are definitely a direct result of how perl's regex works. Nothing that
can't be overcome - but not always with regex (see [this][] example).


3) Even if the above issues didn't exist, how would you be able to convince
all of the implementors to use it in their implementations?

Oh, and to address the original issue starting this thread, along with the
others mentioned, Python-Markdown also parses the url with parenthesis
correctly. I would suggest filing a bug report with whichever
implementation Stack Overflow uses and hope that that implementation is
still under active development.

\X/ /-\ `/ |_ /-\ |\|
Waylan Limberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Markdown-Discuss mailing list