本文整理汇总了PHP中Markdown_Parser::nested_brackets_re方法的典型用法代码示例。如果您正苦于以下问题:PHP Markdown_Parser::nested_brackets_re方法的具体用法?PHP Markdown_Parser::nested_brackets_re怎么用?PHP Markdown_Parser::nested_brackets_re使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Markdown_Parser
的用法示例。
在下文中一共展示了Markdown_Parser::nested_brackets_re方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
protected static function init()
{
if (self::$initialized) {
return;
}
self::$initialized = TRUE;
#
# Prepare regular expressions for seraching emphasis tokens in any
# context.
#
foreach (self::$em_relist as $em => $em_re) {
foreach (self::$strong_relist as $strong => $strong_re) {
# Construct list of allowed token expressions.
$token_relist = array();
if (isset(self::$em_strong_relist["{$em}{$strong}"])) {
$token_relist[] = self::$em_strong_relist["{$em}{$strong}"];
}
$token_relist[] = $em_re;
$token_relist[] = $strong_re;
# Construct master expression from list.
$token_re = '{(' . implode('|', $token_relist) . ')}';
self::$em_strong_prepared_relist["{$em}{$strong}"] = $token_re;
}
}
self::$nested_brackets_re = str_repeat('(?>[^\\[\\]]+|\\[', self::nested_brackets_depth) . str_repeat('\\])*', self::nested_brackets_depth);
self::$nested_url_parenthesis_re = str_repeat('(?>[^()\\s]+|\\(', self::nested_url_parenthesis_depth) . str_repeat('(?>\\)))*', self::nested_url_parenthesis_depth);
self::$escape_chars_re = '[' . preg_quote(self::escape_chars) . ']';
# Sort document, block, and span gamut in ascendent priority order.
asort(self::$document_gamut);
asort(self::$block_gamut);
asort(self::$span_gamut);
}