| @@ 1930-1940 (lines=11) @@ | ||
| 1927 | # Fenced code block marker: find matching end marker. |
|
| 1928 | $fence_indent = strlen($capture[1]); # use captured indent in re |
|
| 1929 | $fence_re = $capture[2]; # use captured fence in re |
|
| 1930 | if (preg_match('{^(?>.*\n)*?[ ]{'.($fence_indent).'}'.$fence_re.'[ ]*(?:\n|$)}', $text, |
|
| 1931 | $matches)) |
|
| 1932 | { |
|
| 1933 | # End marker found: pass text unchanged until marker. |
|
| 1934 | $parsed .= $tag . $matches[0]; |
|
| 1935 | $text = substr($text, strlen($matches[0])); |
|
| 1936 | } |
|
| 1937 | else { |
|
| 1938 | # No end marker: just skip it. |
|
| 1939 | $parsed .= $tag; |
|
| 1940 | } |
|
| 1941 | } |
|
| 1942 | # |
|
| 1943 | # Check for: Indented code block. |
|
| @@ 1957-1967 (lines=11) @@ | ||
| 1954 | else if ($tag{0} == "`") { |
|
| 1955 | # Find corresponding end marker. |
|
| 1956 | $tag_re = preg_quote($tag); |
|
| 1957 | if (preg_match('{^(?>.+?|\n(?!\n))*?(?<!`)'.$tag_re.'(?!`)}', |
|
| 1958 | $text, $matches)) |
|
| 1959 | { |
|
| 1960 | # End marker found: pass text unchanged until marker. |
|
| 1961 | $parsed .= $tag . $matches[0]; |
|
| 1962 | $text = substr($text, strlen($matches[0])); |
|
| 1963 | } |
|
| 1964 | else { |
|
| 1965 | # Unmatched marker: just skip it. |
|
| 1966 | $parsed .= $tag; |
|
| 1967 | } |
|
| 1968 | } |
|
| 1969 | # |
|
| 1970 | # Check for: Opening Block level tag or |
|