With Markdown, the normal route is to make sure you have good HTML processing to apply later, and then add hacks as needed. For >>>>> simple hack would be:
preg_replace_callback("|>{5,}|", function($match) { return preg_replace('|.|', '\>', $match[0]); }, $input);
This adds a backslash to the escape sequence > , which are five or more characters in length.
Fortunately, there are attempts to write more robust marker parsers. One such effort is Upskirt based Sundown, which is in C but has a PHP extension: https://github.com/chobie/php-sundown
source share