Skip to content

Instantly share code, notes, and snippets.

/**
* Sanitize URL — Validate it looks like a URL, then make it less dirty.
*
* Oddnut Software
* Copyright (c) 2010 Eric Ferraiuolo - http://eric.ferraiuolo.name
* MIT License - http://www.opensource.org/licenses/mit-license.php
*
* Examples:
*
* 'Http://WWW.example.com/' » 'http://www.example.com/'
@razass
razass / gist:559428
Created August 31, 2010 17:52 — forked from ericf/gist:554359
/**
* Link Tests
*/
YUI.add('ttw-link-test', function(Y){
var matchSuite = new Y.Test.Suite('Link - Matching'),
sanitizeSuite = new Y.Test.Suite('Link - Sanitize');
function buildMatchTestCase (name, allows, rejects) {