2017 © Pedro Peláez
 

library lib_autolink

Adds anchors to urls in a text

image

iamcal/lib_autolink

Adds anchors to urls in a text

  • Friday, May 22, 2015
  • by iamcal
  • Repository
  • 7 Watchers
  • 47 Stars
  • 150,583 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 16 Forks
  • 7 Open issues
  • 3 Versions
  • 16 % Grown

The README.md

lib_autolink - PHP HTML link formatting library

Build Status Latest Stable Version, (*1)

Find URLs in HTML that are not already links, and make them into links., (*2)

Looking to do this in JavaScript? https://github.com/iamcal/autolink-js, (*3)

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:, (*4)

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

The Versions

22/05 2015

dev-master

9999999-dev

Adds anchors to urls in a text

  Sources   Download

MIT

link anchor autolink

22/05 2015

v1.7

1.7.0.0

Adds anchors to urls in a text

  Sources   Download

MIT

link anchor autolink

10/04 2013

v1.6

1.6.0.0

Adds anchors to urls in a text

  Sources   Download

GPL-3.0 CC-BY-SA-2.5

link anchor autolink