| @@ 1937-1947 (lines=11) @@ | ||
| 1934 | if ($tag{0} == "`") { |
|
| 1935 | # Find corresponding end marker. |
|
| 1936 | $tag_re = preg_quote($tag); |
|
| 1937 | if (preg_match('{^(?>.+?|\n(?!\n))*?(?<!`)'.$tag_re.'(?!`)}', |
|
| 1938 | $text, $matches)) |
|
| 1939 | { |
|
| 1940 | # End marker found: pass text unchanged until marker. |
|
| 1941 | $parsed .= $tag . $matches[0]; |
|
| 1942 | $text = substr($text, strlen($matches[0])); |
|
| 1943 | } |
|
| 1944 | else { |
|
| 1945 | # Unmatched marker: just skip it. |
|
| 1946 | $parsed .= $tag; |
|
| 1947 | } |
|
| 1948 | } |
|
| 1949 | # |
|
| 1950 | # Check for: Indented code block. |
|
| @@ 1963-1973 (lines=11) @@ | ||
| 1960 | else if ($tag{0} == "~") { |
|
| 1961 | # Fenced code block marker: find matching end marker. |
|
| 1962 | $tag_re = preg_quote(trim($tag)); |
|
| 1963 | if (preg_match('{^(?>.*\n)+?'.$tag_re.' *\n}', $text, |
|
| 1964 | $matches)) |
|
| 1965 | { |
|
| 1966 | # End marker found: pass text unchanged until marker. |
|
| 1967 | $parsed .= $tag . $matches[0]; |
|
| 1968 | $text = substr($text, strlen($matches[0])); |
|
| 1969 | } |
|
| 1970 | else { |
|
| 1971 | # No end marker: just skip it. |
|
| 1972 | $parsed .= $tag; |
|
| 1973 | } |
|
| 1974 | } |
|
| 1975 | # |
|
| 1976 | # Check for: Opening Block level tag or |
|