@@ 523-533 (lines=11) @@ | ||
520 | // Fenced code block marker: find matching end marker. |
|
521 | $fence_indent = strlen($capture[1]); // use captured indent in re |
|
522 | $fence_re = $capture[2]; // use captured fence in re |
|
523 | if (preg_match('{^(?>.*\n)*?[ ]{' . ($fence_indent) . '}' . $fence_re . '[ ]*(?:\n|$)}', $text, |
|
524 | $matches)) |
|
525 | { |
|
526 | // End marker found: pass text unchanged until marker. |
|
527 | $parsed .= $tag . $matches[0]; |
|
528 | $text = substr($text, strlen($matches[0])); |
|
529 | } |
|
530 | else { |
|
531 | // No end marker: just skip it. |
|
532 | $parsed .= $tag; |
|
533 | } |
|
534 | } |
|
535 | // Check for: Indented code block. |
|
536 | else if ($tag{0} == "\n" || $tag{0} == " ") { |
|
@@ 546-556 (lines=11) @@ | ||
543 | else if ($tag{0} == "`") { |
|
544 | // Find corresponding end marker. |
|
545 | $tag_re = preg_quote($tag); |
|
546 | if (preg_match('{^(?>.+?|\n(?!\n))*?(?<!`)' . $tag_re . '(?!`)}', |
|
547 | $text, $matches)) |
|
548 | { |
|
549 | // End marker found: pass text unchanged until marker. |
|
550 | $parsed .= $tag . $matches[0]; |
|
551 | $text = substr($text, strlen($matches[0])); |
|
552 | } |
|
553 | else { |
|
554 | // Unmatched marker: just skip it. |
|
555 | $parsed .= $tag; |
|
556 | } |
|
557 | } |
|
558 | // Check for: Opening Block level tag or |
|
559 | // Opening Context Block tag (like ins and del) |