]> andersk Git - test.git/commitdiff
More fine tuning of the regular expressions that detect URLs. We now allow '.' and...
authorMarkus Gutschke <markus@shellinabox.com>
Wed, 8 Jul 2009 17:08:47 +0000 (17:08 +0000)
committerMarkus Gutschke <markus@shellinabox.com>
Wed, 8 Jul 2009 17:08:47 +0000 (17:08 +0000)
ChangeLog
config.h
configure
configure.ac
demo/vt100.js
shellinabox/shell_in_a_box.js
shellinabox/vt100.js
shellinabox/vt100.jspp

index bb5184892e3765d424455444df9c900bd6786303..b5ff00c91061b219c304b04b8b5096f7a1bd9a00 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,11 @@
        * Optionally compress large responses, if the browser accepts
        deflate compression. This mainly improves start up time.
 
+       * More fine tuning of the regular expressions that detect URLs.
+       We now allow '.' and ',' in URLs, as long as they are not at the
+       very end of the URL, where they would probably be part of the
+       enclosing sentence and not actually part of the URL.
+
 2009-07-06  Markus Gutschke  <markus@shellinabox.com>
 
        * Making it easier to host the terminal on non-root URLs by always
index f9069c027e39796e0a0eb6de5f349f09024b03cc..d9f85aea982b2a024638556ad958c046e49a2e94 100644 (file)
--- a/config.h
+++ b/config.h
 #define STDC_HEADERS 1
 
 /* Most recent revision number in the version control system */
-#define VCS_REVISION "142"
+#define VCS_REVISION "143"
 
 /* Version number of package */
 #define VERSION "2.9"
index 69d43a87db3dd6a371869b9b7c2201222ae1b4ed..3b322225e6aa917395873c1c3604a1d7c764b284 100755 (executable)
--- a/configure
+++ b/configure
@@ -2037,7 +2037,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-VCS_REVISION=142
+VCS_REVISION=143
 
 
 cat >>confdefs.h <<_ACEOF
index 74ed798c588214af9ee29e925270715519a464b7..69b5cef2dcf2de7b1d3b246e70fa89e4a6d3bba0 100644 (file)
@@ -2,7 +2,7 @@ AC_PREREQ(2.57)
 
 dnl This is the one location where the authoritative version number is stored
 AC_INIT(shellinabox, 2.9, markus@shellinabox.com)
-VCS_REVISION=142
+VCS_REVISION=143
 AC_SUBST(VCS_REVISION)
 AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}",
                    [Most recent revision number in the version control system])
index c55451b393b1c977fee86c240f7cc9b1cb5cde18..c2b6d005bcb52f37c77f2e7e517343c5cc32572a 100644 (file)
@@ -104,7 +104,7 @@ function VT100(container) {
     '(?:http|https|ftp)://' +
 
     // Optionally allow username and passwords.
-    '(?:[^:@/ ]*(?::[^@/ ]*)?@)?' +
+    '(?:[^:@/ \u00A0]*(?::[^@/ \u00A0]*)?@)?' +
 
     // Hostname.
     '(?:[1-9][0-9]{0,2}(?:[.][1-9][0-9]{0,2}){3}|' +
@@ -115,12 +115,12 @@ function VT100(container) {
     '(?::[1-9][0-9]*)?' +
 
     // Path.
-    '(?:/[^/,.) ]*)*|' +
+    '(?:/(?:(?![/ \u00A0]|[,.)][ \u00A0]|[,.)]$).)*)*|' +
 
     (linkifyURLs <= 1 ? '' :
     // Also support URLs without a protocol (assume "http").
     // Optional username and password.
-    '(?:[^:@/ ]*(?::[^@/ ]*)?@)?' +
+    '(?:[^:@/ \u00A0]*(?::[^@/ \u00A0]*)?@)?' +
 
     // Hostnames must end with a well-known top-level domain or must be
     // numeric.
@@ -146,7 +146,7 @@ function VT100(container) {
     '(?::[1-9][0-9]{0,4})?' +
 
     // Path.
-    '(?:/[^/,.) ]*)*|') +
+    '(?:/(?:(?![/ \u00A0]|[,.)][ \u00A0]|[,.)]$).)*)*|') +
 
     // In addition, support e-mail address. Optionally, recognize "mailto:"
     '(?:mailto:)' + (linkifyURLs <= 1 ? '' : '?') +
@@ -171,7 +171,7 @@ function VT100(container) {
     'yu|za|zm|zw|arpa)(?![a-zA-Z0-9])|[Xx][Nn]--[-a-zA-Z0-9]+)' +
 
     // Optional arguments
-    '(?:[?][^/,.) ]+)?');
+    '(?:[?](?:(?![ \u00A0]|[,.)][ \u00A0]|[,.)]$).)*)?');
   }
   this.initializeElements(container);
   this.initializeAnsiColors();
@@ -980,7 +980,7 @@ VT100.prototype.truncateLines = function(width) {
     if (line.tagName == 'DIV') {
       var x           = 0;
 
-      // Traverse current line and truncate if once we saw "width" characters
+      // Traverse current line and truncate it once we saw "width" characters
       for (var span = line.firstChild; span;
            span = span.nextSibling) {
         var s         = this.getTextContent(span);
@@ -1000,7 +1000,7 @@ VT100.prototype.truncateLines = function(width) {
         // Scan backwards looking for first non-space character
         var s         = this.getTextContent(span);
         for (var i = s.length; i--; ) {
-          if (s.charAt(i) != ' ') {
+          if (s.charAt(i) != ' ' && s.charAt(i) != '\u00A0') {
             if (i+1 != s.length) {
               this.setTextContent(s.substr(0, i+1));
             }
@@ -1253,7 +1253,7 @@ VT100.prototype.putString = function(x, y, text, style) {
       // Scan backwards looking for first non-space character
       s                             = this.getTextContent(span);
       for (var i = s.length; i--; ) {
-        if (s.charAt(i) != ' ') {
+        if (s.charAt(i) != ' ' && s.charAt(i) != '\u00A0') {
           if (i+1 != s.length) {
             this.setTextContent(s.substr(0, i+1));
           }
@@ -1693,7 +1693,7 @@ VT100.prototype.toggleBell = function() {
 };
 
 VT100.prototype.about = function() {
-  alert("VT100 Terminal Emulator " + "2.9 (revision 142)" +
+  alert("VT100 Terminal Emulator " + "2.9 (revision 143)" +
         "\nCopyright 2008-2009 by Markus Gutschke\n" +
         "For more information check http://shellinabox.com");
 };
index 542b6579aec42b6b2a33ca434964a5dac11f5332..2e169dcfa1e7e6bcb74feec57ccef7672aee1e86 100644 (file)
@@ -355,7 +355,7 @@ ShellInABox.prototype.extendContextMenu = function(entries, actions) {
 };
 
 ShellInABox.prototype.about = function() {
-  alert("Shell In A Box version " + "2.9 (revision 142)" +
+  alert("Shell In A Box version " + "2.9 (revision 143)" +
         "\nCopyright 2008-2009 by Markus Gutschke\n" +
         "For more information check http://shellinabox.com" +
         (typeof serverSupportsSSL != 'undefined' && serverSupportsSSL ?
index c55451b393b1c977fee86c240f7cc9b1cb5cde18..c2b6d005bcb52f37c77f2e7e517343c5cc32572a 100644 (file)
@@ -104,7 +104,7 @@ function VT100(container) {
     '(?:http|https|ftp)://' +
 
     // Optionally allow username and passwords.
-    '(?:[^:@/ ]*(?::[^@/ ]*)?@)?' +
+    '(?:[^:@/ \u00A0]*(?::[^@/ \u00A0]*)?@)?' +
 
     // Hostname.
     '(?:[1-9][0-9]{0,2}(?:[.][1-9][0-9]{0,2}){3}|' +
@@ -115,12 +115,12 @@ function VT100(container) {
     '(?::[1-9][0-9]*)?' +
 
     // Path.
-    '(?:/[^/,.) ]*)*|' +
+    '(?:/(?:(?![/ \u00A0]|[,.)][ \u00A0]|[,.)]$).)*)*|' +
 
     (linkifyURLs <= 1 ? '' :
     // Also support URLs without a protocol (assume "http").
     // Optional username and password.
-    '(?:[^:@/ ]*(?::[^@/ ]*)?@)?' +
+    '(?:[^:@/ \u00A0]*(?::[^@/ \u00A0]*)?@)?' +
 
     // Hostnames must end with a well-known top-level domain or must be
     // numeric.
@@ -146,7 +146,7 @@ function VT100(container) {
     '(?::[1-9][0-9]{0,4})?' +
 
     // Path.
-    '(?:/[^/,.) ]*)*|') +
+    '(?:/(?:(?![/ \u00A0]|[,.)][ \u00A0]|[,.)]$).)*)*|') +
 
     // In addition, support e-mail address. Optionally, recognize "mailto:"
     '(?:mailto:)' + (linkifyURLs <= 1 ? '' : '?') +
@@ -171,7 +171,7 @@ function VT100(container) {
     'yu|za|zm|zw|arpa)(?![a-zA-Z0-9])|[Xx][Nn]--[-a-zA-Z0-9]+)' +
 
     // Optional arguments
-    '(?:[?][^/,.) ]+)?');
+    '(?:[?](?:(?![ \u00A0]|[,.)][ \u00A0]|[,.)]$).)*)?');
   }
   this.initializeElements(container);
   this.initializeAnsiColors();
@@ -980,7 +980,7 @@ VT100.prototype.truncateLines = function(width) {
     if (line.tagName == 'DIV') {
       var x           = 0;
 
-      // Traverse current line and truncate if once we saw "width" characters
+      // Traverse current line and truncate it once we saw "width" characters
       for (var span = line.firstChild; span;
            span = span.nextSibling) {
         var s         = this.getTextContent(span);
@@ -1000,7 +1000,7 @@ VT100.prototype.truncateLines = function(width) {
         // Scan backwards looking for first non-space character
         var s         = this.getTextContent(span);
         for (var i = s.length; i--; ) {
-          if (s.charAt(i) != ' ') {
+          if (s.charAt(i) != ' ' && s.charAt(i) != '\u00A0') {
             if (i+1 != s.length) {
               this.setTextContent(s.substr(0, i+1));
             }
@@ -1253,7 +1253,7 @@ VT100.prototype.putString = function(x, y, text, style) {
       // Scan backwards looking for first non-space character
       s                             = this.getTextContent(span);
       for (var i = s.length; i--; ) {
-        if (s.charAt(i) != ' ') {
+        if (s.charAt(i) != ' ' && s.charAt(i) != '\u00A0') {
           if (i+1 != s.length) {
             this.setTextContent(s.substr(0, i+1));
           }
@@ -1693,7 +1693,7 @@ VT100.prototype.toggleBell = function() {
 };
 
 VT100.prototype.about = function() {
-  alert("VT100 Terminal Emulator " + "2.9 (revision 142)" +
+  alert("VT100 Terminal Emulator " + "2.9 (revision 143)" +
         "\nCopyright 2008-2009 by Markus Gutschke\n" +
         "For more information check http://shellinabox.com");
 };
index 7c3e3e981585676e42d055b7b9b18771b833a521..b7a1765f51bc05a65aae0d321f02e40982e44a26 100644 (file)
@@ -104,7 +104,7 @@ function VT100(container) {
     '(?:http|https|ftp)://' +
 
     // Optionally allow username and passwords.
-    '(?:[^:@/ ]*(?::[^@/ ]*)?@)?' +
+    '(?:[^:@/ \u00A0]*(?::[^@/ \u00A0]*)?@)?' +
 
     // Hostname.
     '(?:[1-9][0-9]{0,2}(?:[.][1-9][0-9]{0,2}){3}|' +
@@ -115,12 +115,12 @@ function VT100(container) {
     '(?::[1-9][0-9]*)?' +
 
     // Path.
-    '(?:/[^/,.) ]*)*|' +
+    '(?:/(?:(?![/ \u00A0]|[,.)][ \u00A0]|[,.)]$).)*)*|' +
 
     (linkifyURLs <= 1 ? '' :
     // Also support URLs without a protocol (assume "http").
     // Optional username and password.
-    '(?:[^:@/ ]*(?::[^@/ ]*)?@)?' +
+    '(?:[^:@/ \u00A0]*(?::[^@/ \u00A0]*)?@)?' +
 
     // Hostnames must end with a well-known top-level domain or must be
     // numeric.
@@ -146,7 +146,7 @@ function VT100(container) {
     '(?::[1-9][0-9]{0,4})?' +
 
     // Path.
-    '(?:/[^/,.) ]*)*|') +
+    '(?:/(?:(?![/ \u00A0]|[,.)][ \u00A0]|[,.)]$).)*)*|') +
 
     // In addition, support e-mail address. Optionally, recognize "mailto:"
     '(?:mailto:)' + (linkifyURLs <= 1 ? '' : '?') +
@@ -171,7 +171,7 @@ function VT100(container) {
     'yu|za|zm|zw|arpa)(?![a-zA-Z0-9])|[Xx][Nn]--[-a-zA-Z0-9]+)' +
 
     // Optional arguments
-    '(?:[?][^/,.) ]+)?');
+    '(?:[?](?:(?![ \u00A0]|[,.)][ \u00A0]|[,.)]$).)*)?');
   }
   this.initializeElements(container);
   this.initializeAnsiColors();
@@ -980,7 +980,7 @@ VT100.prototype.truncateLines = function(width) {
     if (line.tagName == 'DIV') {
       var x           = 0;
 
-      // Traverse current line and truncate if once we saw "width" characters
+      // Traverse current line and truncate it once we saw "width" characters
       for (var span = line.firstChild; span;
            span = span.nextSibling) {
         var s         = this.getTextContent(span);
@@ -1000,7 +1000,7 @@ VT100.prototype.truncateLines = function(width) {
         // Scan backwards looking for first non-space character
         var s         = this.getTextContent(span);
         for (var i = s.length; i--; ) {
-          if (s.charAt(i) != ' ') {
+          if (s.charAt(i) != ' ' && s.charAt(i) != '\u00A0') {
             if (i+1 != s.length) {
               this.setTextContent(s.substr(0, i+1));
             }
@@ -1253,7 +1253,7 @@ VT100.prototype.putString = function(x, y, text, style) {
       // Scan backwards looking for first non-space character
       s                             = this.getTextContent(span);
       for (var i = s.length; i--; ) {
-        if (s.charAt(i) != ' ') {
+        if (s.charAt(i) != ' ' && s.charAt(i) != '\u00A0') {
           if (i+1 != s.length) {
             this.setTextContent(s.substr(0, i+1));
           }
This page took 0.063428 seconds and 5 git commands to generate.