Skip to content

Instantly share code, notes, and snippets.

@cebe
Created May 7, 2016 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cebe/615bef8086c9a11d81f568284c18fec5 to your computer and use it in GitHub Desktop.
Save cebe/615bef8086c9a11d81f568284c18fec5 to your computer and use it in GitHub Desktop.
Demo for demonstrating maximum nesting level in markdown parser.
{
"require": {
"league/commonmark": "^0.13.2"
}
}
<?php
use League\CommonMark\CommonMarkConverter;
require(__DIR__ . '/vendor/autoload.php');
// in case you have xdebug extension, you do not
// have this check in production, so we set it really high
ini_set('xdebug.max_nesting_level', 100000);
$converter = new CommonMarkConverter();
echo $converter->convertToHtml(str_repeat('> ', 10000));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment