Rah's Urltolink

Rah_urltolink has been dropped. The plugin always used a super-simple regular expression which really doesn’t need it’s own plugin. The same can be done using the great new and existing tools, including rah_function and pax_grep.

For those interested in modifying and parsing markup, there are also tools even better available, like for instance etc_query. Unlike regular expression based solutions, etc_query can understands the actual markup structure and can do dynamic modification reliably since the plugin uses xPath.

For general linking needs there is also adi_link and of course built-in link tags.

We still offer rah_urltolink's old downloads to those that want it, but please be careful. Old things may get outdated fast and things can break. Using the old downloads on production environment is not recommended.

Rah_ulrtolink worked by running few regular expressions. These same limited regular expression can be run using the regular expression plugin pax_grep or the general function tool, rah_function.

To turn any word instance that resembles a link. This converts any word starting with a protocol http, https, ftp and ftps to a HTML link:

<txp:rah_function call="preg_replace" pattern="#([>\s\A]+)(((http://|https://|ftp://|ftps://)([a-zA-Z0-9-]+\.){0,}([a-zA-Z0-9-\./\_\?\%\#\&\=\;\~\!\(\)]+))([^?\s<>,.!]))#" replacement="$1<a href=""$2"">$0</a>" thing="here">
	<p>Some content with http://www.example.com/ here.</p>

The above is the same deal as used in the rah_urltolink, producing the exact same results as a plain links go. To link any what-seems-to-be email address:

<txp:rah_function call="preg_replace" pattern="#([>\s\A]+)((([a-zA-z0-9-\.]+@[a-zA-z0-9-\.]+)([a-zA-Z0-9-\./\_\?\%\#\&\=\;\~\!\(\)]+))([^?\s<>,.!]))#" replacement="$1<a href=""mailto:$2"">$0</a>" thing="here">
	<p>Some content with some emails like some@email.com that here.</p>

Please keep in mind that just like the original plugin, these are regular expressions. Which is one of the reasons why the plugin is dropped. It doesn’t serve the purpose well. Regular expressions are just regular expressions, they do not care about markup or where the matched needle is.