From fbb1d6ff5bb2472387075b56fdaf8aa99d1537c8 Mon Sep 17 00:00:00 2001 From: BlackLight <blacklight@autistici.org> Date: Wed, 9 Feb 2011 17:02:30 +0100 Subject: [PATCH] Fixing cat and wget (thanks again to tragic0mic) --- commands/cat.json | 3 ++- commands/wget.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/commands/cat.json b/commands/cat.json index 5916f59..771eb2d 100644 --- a/commands/cat.json +++ b/commands/cat.json @@ -35,7 +35,7 @@ } else if ( dir[i].link_to && dir[i].link_to.length > 0 ) { return this.action ( dir[i].link_to ); } else if ( dir[i].content ) { - var replaced=dir[i].content.replace(/(https?:\/\/(www\.)?[0-9a-zA-Z-_\.\/:]*)/g, "<a href='$1'>$1</a>"); + var replaced=dir[i].content.replace(/(https?:\/\/(www\.)?[0-9a-zA-Z-_\.\/:\?#=&]*)/g, "<a href='$1'>$1</a>"); replaced = replaced.replace(".'>", "'>"); replaced = replaced.replace(".</a>", "</a>."); return "<pre>"+replaced+"</pre>"; @@ -56,3 +56,4 @@ } } + diff --git a/commands/wget.json b/commands/wget.json index 4e041e7..9d431ea 100644 --- a/commands/wget.json +++ b/commands/wget.json @@ -33,7 +33,7 @@ var wgetWin = window.open("_blank",""); if(wgetWin) { - wgetWin.document.write(dir[i].content); + wgetWin.document.write("<pre>"+dir[i].content+"</pre>"); return "<br />"; } else @@ -56,3 +56,4 @@ } } +