Project

linky

0.0
No commit activity in last 3 years
No release in over 3 years
A library for safely linking keywords to urls within HTML content.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 1.4.3.1
 Project Readme

Linky

A simple gem for safely linking keywords within HTML (i.e., it's more than a gsub). Built on top of Nokogiri.

Installation

$ gem install linky

Usage

Call the Linky.link method:

require 'linky'
html = "<p>link the first occurance of the word "more."</p><div>some more text</div>"
Linky.link "more", "http://more.com", html, :class => "linky"
# returns "<p>link the first occurance of the word "<a href="http://more.com" class="linky">more</a>."</p><div>some more text</div>"

Docs

Docs are on "rdoc.info":http://rdoc.info