MarkdownExtra.php
protected function consumeFencedCode($lines, $current)
	{
		// consume until ```
		$block = [
			'code',
		];
		$line = trim($lines[$current]);
		if (($pos = strrpos($line, '`')) === false) {
			$pos = strrpos($line, '~');
		}
		$fence = substr($line, 0, $pos + 1);
		$block['attributes'] = substr($line, $pos);
		$content = [];
		for($i = $current + 1, $count = count($lines); $i < $count; $i++) {
			if (($pos = strpos($line = $lines[$i], $fence)) === false || $pos > 3) {
				$content[] = $line;
			} else {
				break;
			}
		}
		$block['content'] = implode("\n", $content);
		return [$block, $i];
	}
protected function consumeFencedCode($lines, $current)
	{
		// consume until ```
		$block = [
			'code',
		];
		$line = trim($lines[$current]);
		if (($pos = strrpos($line, '`')) === false) {
			$pos = strrpos($line, '~');
		}
		$fence = substr($line, 0, $pos + 1);
		$block['attributes'] = substr($line, $pos);
		$content = [];
		for($i = $current + 1, $count = count($lines); $i < $count; $i++) {
			if (($pos = strpos($line = $lines[$i], $fence)) === false || $pos > 3) {
				$content[] = $line;
			} else {
				break;
			}
		}
		$block['content'] = implode("\n", $content);
		return [$block, $i];
	}
Consume lines for a fenced code block