You are here

function Markdown_Parser::doHorizontalRules in Markdown 6

Same name and namespace in other branches
  1. 5 markdown.php \Markdown_Parser::doHorizontalRules()

File

./markdown.php, line 623

Class

Markdown_Parser

Code

function doHorizontalRules($text) {

  # Do Horizontal Rules:
  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);
}