protected function consumeReference($lines, $current)
	{
		while (isset($lines[$current]) && preg_match('/^ {0,3}\[(.+?)\]:\s*(.+?)(?:\s+[\(\'"](.+?)[\)\'"])?\s*('.$this->_specialAttributesRegex.')?\s*$/', $lines[$current], $matches)) {
			$label = strtolower($matches[1]);

			$this->references[$label] = [
				'url' => $this->replaceEscape($matches[2]),
			];
			if (isset($matches[3])) {
				$this->references[$label]['title'] = $matches[3];
			} else {
				// title may be on the next line
				if (isset($lines[$current + 1]) && preg_match('/^\s+[\(\'"](.+?)[\)\'"]\s*$/', $lines[$current + 1], $matches)) {
					$this->references[$label]['title'] = $matches[1];
					$current++;
				}
			}
			if (isset($matches[5])) {
				$this->references[$label]['attributes'] = $matches[5];
			}
			$current++;
		}
		return [false, --$current];
	}
protected function consumeReference($lines, $current)
	{
		while (isset($lines[$current]) && preg_match('/^ {0,3}\[(.+?)\]:\s*(.+?)(?:\s+[\(\'"](.+?)[\)\'"])?\s*('.$this->_specialAttributesRegex.')?\s*$/', $lines[$current], $matches)) {
			$label = strtolower($matches[1]);

			$this->references[$label] = [
				'url' => $this->replaceEscape($matches[2]),
			];
			if (isset($matches[3])) {
				$this->references[$label]['title'] = $matches[3];
			} else {
				// title may be on the next line
				if (isset($lines[$current + 1]) && preg_match('/^\s+[\(\'"](.+?)[\)\'"]\s*$/', $lines[$current + 1], $matches)) {
					$this->references[$label]['title'] = $matches[1];
					$current++;
				}
			}
			if (isset($matches[5])) {
				$this->references[$label]['attributes'] = $matches[5];
			}
			$current++;
		}
		return [false, --$current];
	}
protected function consumeReference ( $ lines , $ current ) { while ( isset ( $ lines [ $ current ] ) && preg_match ( '/^ {0,3}\[(.+?)\]:\s*(.+?)(?:\s+[\(\'"](.+?)[\)\'"])?\s*(' . $ this -> _specialAttributesRegex . ')?\s*$/' , $ lines [ $ current ] , $ matches ) ) { $ label = strtolower ( $ matches [ 1 ] ) ; $ this -> references [ $ label ] = [ 'url' => $ this -> replaceEscape ( $ matches [ 2 ] ) , ] ; if ( isset ( $ matches [ 3 ] ) ) { $ this -> references [ $ label ] [ 'title' ] = $ matches [ 3 ] ; } else { // title may be on the next line if ( isset ( $ lines [ $ current + 1 ] ) && preg_match ( '/^\s+[\(\'"](.+?)[\)\'"]\s*$/' , $ lines [ $ current + 1 ] , $ matches ) ) { $ this -> references [ $ label ] [ 'title' ] = $ matches [ 1 ] ; $ current ++ ; } } if ( isset ( $ matches [ 5 ] ) ) { $ this -> references [ $ label ] [ 'attributes' ] = $ matches [ 5 ] ; } $ current ++ ; } return [ false , -- $ current ] ; }
Consume link references
Consume link references