Improve the Markdown escaping logic.

Review Request #5322 — Created Jan. 24, 2014 and submitted — Latest diff uploaded

Information

Review Board
master

Reviewers

Improve the Markdown escaping logic.

This improves our Markdown escaping to better handle parens,
underscores, and asterisks.

The common cases of showing function names with parens and underscores
should no longer result in a bunch of escaping. We now do a better job
of escaping only when they're going to cause formatting changes.

Since some of the regexes were getting a bit longer, I've also
repositioned the comments in the regexes to appear before the regex
lines.

Unit tests pass.

Posting a change with a bunch of formatting, some that should be
escaped and some that shouldn't. This included functions like
this_is_a_test(). The contents were preserved and not escaped.