function Markdown_Parser::prepareItalicsAndBold in Markdown 6
Same name and namespace in other branches
- 5 markdown.php \Markdown_Parser::prepareItalicsAndBold()
1 call to Markdown_Parser::prepareItalicsAndBold()
File
- ./
markdown.php, line 1175
Class
Code
function prepareItalicsAndBold() {
#
# Prepare regular expressions for searching emphasis tokens in any
# context.
#
foreach ($this->em_relist as $em => $em_re) {
foreach ($this->strong_relist as $strong => $strong_re) {
# Construct list of allowed token expressions.
$token_relist = array();
if (isset($this->em_strong_relist["{$em}{$strong}"])) {
$token_relist[] = $this->em_strong_relist["{$em}{$strong}"];
}
$token_relist[] = $em_re;
$token_relist[] = $strong_re;
# Construct master expression from list.
$token_re = '{(' . implode('|', $token_relist) . ')}';
$this->em_strong_prepared_relist["{$em}{$strong}"] = $token_re;
}
}
}