org\parser\driver\Markdown::parseSpan PHP Метод

parseSpan() защищенный Метод

protected parseSpan ( $str )
    protected function parseSpan($str)
    {
        #
        # Take the string $str and parse it into tokens, hashing embeded HTML,
        # escaped characters and handling code spans.
        #
        $output = '';
        $span_re = '{
				(
					\\\\' . $this->escape_chars_re . '
				|
					(?<![`\\\\])
					`+						# code span marker
			' . ($this->no_markup ? '' : '
				|
					<!--    .*?     -->		# comment
				|
					<\\?.*?\\?> | <%.*?%>		# processing instruction
				|
					<[!$]?[-a-zA-Z0-9:_]+	# regular tags
					(?>
						\\s
						(?>[^"\'>]+|"[^"]*"|\'[^\']*\')*
					)?
					>
				|
					<[-a-zA-Z0-9:_]+\\s*/> # xml-style empty tag
				|
					</[-a-zA-Z0-9:_]+\\s*> # closing tag
			') . '
				)
				}xs';
        while (1) {
            #
            # Each loop iteration seach for either the next tag, the next
            # openning code span marker, or the next escaped character.
            # Each token is then passed to handleSpanToken.
            #
            $parts = preg_split($span_re, $str, 2, PREG_SPLIT_DELIM_CAPTURE);
            # Create token from text preceding tag.
            if ("" != $parts[0]) {
                $output .= $parts[0];
            }
            # Check if we reach the end.
            if (isset($parts[1])) {
                $output .= $this->handleSpanToken($parts[1], $parts[2]);
                $str = $parts[2];
            } else {
                break;
            }
        }
        return $output;
    }