| @@ 1919-1929 (lines=11) @@ | ||
| 1916 | # Fenced code block marker: find matching end marker. |
|
| 1917 | $fence_indent = strlen($capture[1]); # use captured indent in re |
|
| 1918 | $fence_re = $capture[2]; # use captured fence in re |
|
| 1919 | if (preg_match('{^(?>.*\n)*?[ ]{'.($fence_indent).'}'.$fence_re.'[ ]*(?:\n|$)}', $text, |
|
| 1920 | $matches)) |
|
| 1921 | { |
|
| 1922 | # End marker found: pass text unchanged until marker. |
|
| 1923 | $parsed .= $tag . $matches[0]; |
|
| 1924 | $text = substr($text, strlen($matches[0])); |
|
| 1925 | } |
|
| 1926 | else { |
|
| 1927 | # No end marker: just skip it. |
|
| 1928 | $parsed .= $tag; |
|
| 1929 | } |
|
| 1930 | } |
|
| 1931 | # |
|
| 1932 | # Check for: Indented code block. |
|
| @@ 1946-1956 (lines=11) @@ | ||
| 1943 | else if ($tag{0} == "`") { |
|
| 1944 | # Find corresponding end marker. |
|
| 1945 | $tag_re = preg_quote($tag); |
|
| 1946 | if (preg_match('{^(?>.+?|\n(?!\n))*?(?<!`)'.$tag_re.'(?!`)}', |
|
| 1947 | $text, $matches)) |
|
| 1948 | { |
|
| 1949 | # End marker found: pass text unchanged until marker. |
|
| 1950 | $parsed .= $tag . $matches[0]; |
|
| 1951 | $text = substr($text, strlen($matches[0])); |
|
| 1952 | } |
|
| 1953 | else { |
|
| 1954 | # Unmatched marker: just skip it. |
|
| 1955 | $parsed .= $tag; |
|
| 1956 | } |
|
| 1957 | } |
|
| 1958 | # |
|
| 1959 | # Check for: Opening Block level tag or |
|