Permalink
Browse files

Fixed a bug introduced while moving code to prepareItalicsAndBold.

  • Loading branch information...
1 parent 9c0365f commit a9bdbe6cea568ca3a2c727211ac817537f3bbb1d @michelf committed Jun 21, 2008
Showing with 8 additions and 5 deletions.
  1. +8 −5 markdown.php
View
13 markdown.php
@@ -1124,15 +1124,18 @@ function prepareItalicsAndBold() {
# Prepare regular expressions for seraching emphasis tokens in any
# context.
#
- foreach ($this->em_relist as $em => $expression) {
- foreach ($this->strong_relist as $strong => $expression) {
+ 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[] = $this->strong_relist[$strong];
- $token_relist[] = $this->em_relist[$em];
- $token_re = '{('. implode('|', $token_relist) .')}';
+ $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;
}
}

0 comments on commit a9bdbe6

Please sign in to comment.