You are here

protected function Markdown::doHorizontalRules in Markdown 7

* Convert horizontal rules *

Parameters

string $text: * @return string

File

includes/Markdown.php, line 573

Class

Markdown
Markdown Parser Class

Namespace

Michelf

Code

protected function doHorizontalRules($text) {
  return preg_replace('{
				^[ ]{0,3}	# Leading space
				([-*_])		# $1: First marker
				(?>			# Repeated marker group
					[ ]{0,2}	# Zero, one, or two spaces.
					\\1			# Marker character
				){2,}		# Group repeated at least twice
				[ ]*		# Tailing spaces
				$			# End of line.
			}mx', "\n" . $this
    ->hashBlock("<hr{$this->empty_element_suffix}") . "\n", $text);
}