iamcal/lib_autolink 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

iamcal/lib_autolink

最新稳定版本:v1.9

Composer 安装命令:

composer require iamcal/lib_autolink

包简介

Adds anchors to urls in a text

README 文档

README

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

统计信息

  • 总下载量: 1.24M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 63
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 63
  • Watchers: 6
  • Forks: 22
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-10-26