You are here

function Markdown_Parser::doAutoLinks in Markdown 5

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

File

./markdown.php, line 1414

Class

Markdown_Parser

Code

function doAutoLinks($text) {
  $text = preg_replace_callback('{<((https?|ftp|dict):[^\'">\\s]+)>}i', array(
    &$this,
    '_doAutoLinks_url_callback',
  ), $text);

  # Email addresses: <address@domain.foo>
  $text = preg_replace_callback('{
			<
			(?:mailto:)?
			(
				[-.\\w\\x80-\\xFF]+
				\\@
				[-a-z0-9\\x80-\\xFF]+(\\.[-a-z0-9\\x80-\\xFF]+)*\\.[a-z]+
			)
			>
			}xi', array(
    &$this,
    '_doAutoLinks_email_callback',
  ), $text);
  return $text;
}