src/mako/utility/Str.php
public static function autolink(string $string, array $attributes = []): string
	{
		return preg_replace_callback('#\b(?<!href="|">)[a-z]+://\S+(?:/|\b)#i', function($matches) use ($attributes)
		{
			return (new HTML())->tag('a', ['href' => $matches[0]] + $attributes, $matches[0]);
		}, $string);
	}
public static function autolink(string $string, array $attributes = []): string
	{
		return preg_replace_callback('#\b(?<!href="|">)[a-z]+://\S+(?:/|\b)#i', function($matches) use ($attributes)
		{
			return (new HTML())->tag('a', ['href' => $matches[0]] + $attributes, $matches[0]);
		}, $string);
	}
public static function autolink ( string $ string , array $ attributes = [ ] ) : string { return preg_replace_callback ( '#\b(?<!href="|">)[a-z]+://\S+(?:/|\b)#i' , function ( $ matches ) use ( $ attributes ) { return ( new HTML ( ) ) -> tag ( 'a' , [ 'href' => $ matches [ 0 ] ] + $ attributes , $ matches [ 0 ] ) ; } , $ string ) ; }
Converts URLs in a text into clickable links.

@param  string $string     Text to scan for links
@param  array  $attributes Anchor attributes
@return string
Converts URLs in a text into clickable links .