本文整理匯總了PHP中Markdown_Parser::escape_chars_re方法的典型用法代碼示例。如果您正苦於以下問題:PHP Markdown_Parser::escape_chars_re方法的具體用法?PHP Markdown_Parser::escape_chars_re怎麽用?PHP Markdown_Parser::escape_chars_re使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Markdown_Parser
的用法示例。
在下文中一共展示了Markdown_Parser::escape_chars_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);
}