protected function parseInline($text)
	{
		if ($this->_depth >= $this->maximumNestingLevel) {
			// maximum depth is reached, do not parse input
			return [['text', $text]];
		}
		$this->_depth++;

		$markers = implode('', array_keys($this->_inlineMarkers));

		$paragraph = [];

		while (!empty($markers) && ($found = strpbrk($text, $markers)) !== false) {

			$pos = strpos($text, $found);

			// add the text up to next marker to the paragraph
			if ($pos !== 0) {
				$paragraph[] = ['text', substr($text, 0, $pos)];
			}
			$text = $found;

			$parsed = false;
			foreach ($this->_inlineMarkers[$text[0]] as $marker => $method) {
				if (strncmp($text, $marker, strlen($marker)) === 0) {
					// parse the marker
					array_unshift($this->context, $method);
					list($output, $offset) = $this->$method($text);
					array_shift($this->context);

					$paragraph[] = $output;
					$text = substr($text, $offset);
					$parsed = true;
					break;
				}
			}
			if (!$parsed) {
				$paragraph[] = ['text', substr($text, 0, 1)];
				$text = substr($text, 1);
			}
		}

		$paragraph[] = ['text', $text];

		$this->_depth--;

		return $paragraph;
	}
protected function parseInline($text)
	{
		if ($this->_depth >= $this->maximumNestingLevel) {
			// maximum depth is reached, do not parse input
			return [['text', $text]];
		}
		$this->_depth++;

		$markers = implode('', array_keys($this->_inlineMarkers));

		$paragraph = [];

		while (!empty($markers) && ($found = strpbrk($text, $markers)) !== false) {

			$pos = strpos($text, $found);

			// add the text up to next marker to the paragraph
			if ($pos !== 0) {
				$paragraph[] = ['text', substr($text, 0, $pos)];
			}
			$text = $found;

			$parsed = false;
			foreach ($this->_inlineMarkers[$text[0]] as $marker => $method) {
				if (strncmp($text, $marker, strlen($marker)) === 0) {
					// parse the marker
					array_unshift($this->context, $method);
					list($output, $offset) = $this->$method($text);
					array_shift($this->context);

					$paragraph[] = $output;
					$text = substr($text, $offset);
					$parsed = true;
					break;
				}
			}
			if (!$parsed) {
				$paragraph[] = ['text', substr($text, 0, 1)];
				$text = substr($text, 1);
			}
		}

		$paragraph[] = ['text', $text];

		$this->_depth--;

		return $paragraph;
	}
protected function parseInline ( $ text ) { if ( $ this -> _depth >= $ this -> maximumNestingLevel ) { // maximum depth is reached, do not parse input return [ [ 'text' , $ text ] ] ; } $ this -> _depth ++ ; $ markers = implode ( '' , array_keys ( $ this -> _inlineMarkers ) ) ; $ paragraph = [ ] ; while ( ! empty ( $ markers ) && ( $ found = strpbrk ( $ text , $ markers ) ) !== false ) { $ pos = strpos ( $ text , $ found ) ; // add the text up to next marker to the paragraph if ( $ pos !== 0 ) { $ paragraph [ ] = [ 'text' , substr ( $ text , 0 , $ pos ) ] ; } $ text = $ found ; $ parsed = false ; foreach ( $ this -> _inlineMarkers [ $ text [ 0 ] ] as $ marker => $ method ) { if ( strncmp ( $ text , $ marker , strlen ( $ marker ) ) === 0 ) { // parse the marker array_unshift ( $ this -> context , $ method ) ; list ( $ output , $ offset ) = $ this -> $ method ( $ text ) ; array_shift ( $ this -> context ) ; $ paragraph [ ] = $ output ; $ text = substr ( $ text , $ offset ) ; $ parsed = true ; break ; } } if ( ! $ parsed ) { $ paragraph [ ] = [ 'text' , substr ( $ text , 0 , 1 ) ] ; $ text = substr ( $ text , 1 ) ; } } $ paragraph [ ] = [ 'text' , $ text ] ; $ this -> _depth -- ; return $ paragraph ; }
Parses inline elements of the language.

@param string $text the inline text to parse.
@return array
Parses inline elements of the language .