[tor-commits] [pups/master] [#12625] Stops prodromus from eating http/https links
lunar at torproject.org
lunar at torproject.org
Sat Oct 11 09:48:58 UTC 2014
commit dff26ee81d74a11a40a39d7b57e942e2f9fdebb5
Author: Sherief <sheriefalaa.w at gmail.com>
Date: Thu Oct 2 01:07:59 2014 +0200
[#12625] Stops prodromus from eating http/https links
The webchat UI previously ate http/https from links as a form of
simplifying/beautifying urls but that proved bad when users copy/pasted
logs so now it displays full links instead of simpler ones.
---
static/js/prodromus.js | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/static/js/prodromus.js b/static/js/prodromus.js
index 7dbe826..29b2331 100644
--- a/static/js/prodromus.js
+++ b/static/js/prodromus.js
@@ -105,13 +105,7 @@ Prodromus.Util = {
text = text.replace(
/((https?\:\/\/|ftp\:\/\/)|(www\.))(\S+)(\w{2,4})(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/gi
, function( url ) {
- nice = url;
- if( url.match( "^https?:\/\/" ) ) {
- nice = nice.replace( /^https?:\/\//i, "" )
- } else {
- url = 'http://'+url;
- }
- return '<a target="_blank" href="' + url + '">' + nice.replace( /^www./i, "" ) + '</a>';
+ return '<a target="_blank" href="' + url + '">' + url + '</a>';
}
);
More information about the tor-commits
mailing list