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