| @@ 277-287 (lines=11) @@ | ||
| 274 | if ($tag{0} == "`") { |
|
| 275 | # Find corresponding end marker. |
|
| 276 | $tag_re = preg_quote($tag); |
|
| 277 | if (preg_match('{^(?>.+?|\n(?!\n))*?(?<!`)'.$tag_re.'(?!`)}', |
|
| 278 | $text, $matches)) |
|
| 279 | { |
|
| 280 | # End marker found: pass text unchanged until marker. |
|
| 281 | $parsed .= $tag . $matches[0]; |
|
| 282 | $text = substr($text, strlen($matches[0])); |
|
| 283 | } |
|
| 284 | else { |
|
| 285 | # Unmatched marker: just skip it. |
|
| 286 | $parsed .= $tag; |
|
| 287 | } |
|
| 288 | } |
|
| 289 | # |
|
| 290 | # Check for: Fenced code block marker. |
|
| @@ 295-305 (lines=11) @@ | ||
| 292 | else if (preg_match('{^\n?[ ]{0,'.($indent+3).'}~}', $tag)) { |
|
| 293 | # Fenced code block marker: find matching end marker. |
|
| 294 | $tag_re = preg_quote(trim($tag)); |
|
| 295 | if (preg_match('{^(?>.*\n)+?[ ]{0,'.($indent).'}'.$tag_re.'[ ]*\n}', $text, |
|
| 296 | $matches)) |
|
| 297 | { |
|
| 298 | # End marker found: pass text unchanged until marker. |
|
| 299 | $parsed .= $tag . $matches[0]; |
|
| 300 | $text = substr($text, strlen($matches[0])); |
|
| 301 | } |
|
| 302 | else { |
|
| 303 | # No end marker: just skip it. |
|
| 304 | $parsed .= $tag; |
|
| 305 | } |
|
| 306 | } |
|
| 307 | # |
|
| 308 | # Check for: Indented code block. |
|