Permalink
Browse files

Slightly improve textile.js link handling

  • Loading branch information...
1 parent 1093a50 commit 4df63fb1c14ae360b2a10a3cd43ca6a7ace153d4 @namelessjon committed Feb 28, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 helpers/textile.js
View
@@ -98,7 +98,7 @@ function prep(m){
m=m.replace(/\"([^\"]+)\":((http|https|mailto):\S+)/g,'<a href="$2">$1<\/a>');
m = make_image(m,/!([^!\s]+)!:(\S+)/);
m = make_image(m,/!([^!\s]+)!/);
- m=m.replace(/"([^\"]+)":(\S+)/g,function($0,$1,$2){return tag("a",qat('href',aliases[$2]),$1)});
+ m=m.replace(/"([^\"]+)":(\S+)/g,function($0,$1,$2){return tag("a",qat('href',aliases[$2] || ("http://" + $2)),$1)});
m=m.replace(/(=)?"([^\"]+)"/g,function($0,$1,$2){return ($1)?$0:"&#8220;"+$2+"&#8221;"});
return m;
}

0 comments on commit 4df63fb

Please sign in to comment.