linkify-instagram
Advanced tools
Comparing version 0.3.0 to 0.4.0
{ | ||
"name": "linkify-instagram", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Linkify Instagram captions or comments", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,3 +5,5 @@ linkify-instagram (WIP) | ||
[![npm version](https://badge.fury.io/js/linkify-instagram.svg)](https://www.npmjs.com/package/linkify-instagram) | ||
[![Build Status](https://travis-ci.org/abh1nav/linkify-instagram.svg?branch=master)](https://travis-ci.org/abh1nav/linkify-instagram) | ||
[![Build Status](https://travis-ci.org/abh1nav/linkify-instagram.svg?branch=master)](https://travis-ci.org/abh1nav/linkify-instagram) | ||
[Click here](https://tonicdev.com/npm/linkify-instagram) to try it out in your browser. | ||
@@ -8,0 +10,0 @@ ## Sample Usage |
@@ -6,3 +6,3 @@ var _ = require('lodash'); | ||
module.exports = function(text) { | ||
module.exports = function(text, htTemplate, unTemplate) { | ||
// Hashtags | ||
@@ -12,3 +12,3 @@ var hashtags = text.match(/[#]\w+/g); | ||
_.forEach(hashtags, function(ht) { | ||
text = text.replace(ht, hashtag(ht)); | ||
text = text.replace(ht, hashtag(ht, htTemplate)); | ||
}); | ||
@@ -21,3 +21,3 @@ }; | ||
_.forEach(usernames, function(un) { | ||
text = text.replace(un, username(un)); | ||
text = text.replace(un, username(un, unTemplate)); | ||
}); | ||
@@ -24,0 +24,0 @@ } |
10701
30