Skip to content

Instantly share code, notes, and snippets.

View meenie's full-sized avatar
🚀

Cody Lundquist meenie

🚀
  • Qualified.com
  • Bend, OR
  • 00:55 (UTC -07:00)
View GitHub Profile
@meenie
meenie / filters.js
Last active December 19, 2015 21:09 — forked from jakemmarsh/filters.js
app.filter('parseUrl', function () {
var replacements = [
{
//URLs starting with http://, https://, or ftp://
search: /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,
replace: '<a href="$1" target="_blank">$1</a>'
},
{
//URLs starting with "www." (without // before it, or it'd re-link the ones done above).
search: /(^|[^\/])(www\.[\S]+(\b|$))/gim,