Skip to content

rsusanto/lib_autolink

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lib_autolink - PHP HTML link formatting library

Build Status Latest Stable Version

Find URLs in HTML that are not already links, and make them into links.

Looking to do this in JavaScript? https://github.com/iamcal/autolink-js

Usage

include('lib_autolink.php');


# simple mode
$html = autolink($html);

# truncate URLs longer than 20 characters
$html = autolink($html, 20);

# insert some magic into the <a> tags
$html = autolink($html, 30, ' class="mylink"');

# By default if the display url is truncated, a title attribute is added to the link, if you don't want this, add a 4th parameter of false
$html = autolink($html, 30, ' class="mylink"', false);

# link up email address
$html = autolink_email($html);

Testing

If you have perl's Test::Harness installed (you almost certainly do), you can run the tests using:

prove --exec 'php' t/*.t

About

PHP HTML link formatting library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 63.4%
  • Perl 23.8%
  • Raku 12.8%