fix the quote linky thingy on the web whatsit

This commit is contained in:
reality 2013-10-15 06:06:16 +00:00
parent 3df467e35e
commit 05f2fdb8a3
2 changed files with 5 additions and 7 deletions

View File

@ -8,9 +8,7 @@ var pages = function(dbot) {
res.render('quotes', {
'name': dbot.config.name,
'quotes': category.quotes,
'locals': {
'url_regex': RegExp.prototype.url_regex()
}
'url_regex': new RegExp(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig)
});
} else {
res.render('error', {

View File

@ -6,7 +6,7 @@ block content
ul#quotelist
-var hasYouTubeVids=false
-each quote in quotes
-if(quote.match(locals.url_regex))
-if(quote.match(url_regex))
li.quote
-if(quote.match(/(jpg|png|gif|jpeg|tiff)$/))
a(href=quote)
@ -18,7 +18,7 @@ block content
-else
a(href=quote)
=quote
-else if(quote.match(/~~([^~]+)~~/))
-else
-var res = quote.match(/~~([^~]+)~~/)
-if(res != null)
li.quote