This is an automated email from the ASF dual-hosted git repository.

neilcsmith pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 983d271  [NETBEANS-4593] Recognize a URL which contains "@"
     new c48107f  Merge pull request #2258 from 
junichi11/netbeans-4593-editor-url
983d271 is described below

commit 983d2718992a3ccf8cb7e80f2271517a5b125a49
Author: Junichi Yamamoto <[email protected]>
AuthorDate: Thu Jul 16 21:22:47 2020 +0900

    [NETBEANS-4593] Recognize a URL which contains "@"
---
 ide/editor/src/org/netbeans/modules/editor/url/Parser.java            | 4 ++--
 .../test/unit/src/org/netbeans/modules/editor/url/ParserTest.java     | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ide/editor/src/org/netbeans/modules/editor/url/Parser.java 
b/ide/editor/src/org/netbeans/modules/editor/url/Parser.java
index 4ce8e84..d447f06 100644
--- a/ide/editor/src/org/netbeans/modules/editor/url/Parser.java
+++ b/ide/editor/src/org/netbeans/modules/editor/url/Parser.java
@@ -61,7 +61,7 @@ public final class Parser {
                     case '%': case '_': case '~': case '=': //NOI18N
                     case '\\':case '&': case '$': case '-': //NOI18N
                     case '#': case ',': case ':': case ';': //NOI18N
-                    case '!': case '(': case ')': //NOI18N
+                    case '!': case '(': case ')': case '@': //NOI18N
                         continue OUTER;
                 }
 
@@ -155,7 +155,7 @@ public final class Parser {
         return result;
     }
     
-    private static final Pattern URL_PATTERN = 
Pattern.compile("(ht|f)(tp(s?)|ile)://[0-9a-zA-Z/.?%+_~=\\\\&$\\-#,:!/(/)]*"); 
//NOI18N
+    private static final Pattern URL_PATTERN = 
Pattern.compile("(ht|f)(tp(s?)|ile)://[0-9a-zA-Z/.?%+_~=\\\\&@$\\-#,:!/(/)]*"); 
//NOI18N
 
     public static Iterable<int[]> recognizeURLsREBased(CharSequence text) {
         Matcher m = URL_PATTERN.matcher(text);
diff --git 
a/ide/editor/test/unit/src/org/netbeans/modules/editor/url/ParserTest.java 
b/ide/editor/test/unit/src/org/netbeans/modules/editor/url/ParserTest.java
index 664fd1e..89a8c36 100644
--- a/ide/editor/test/unit/src/org/netbeans/modules/editor/url/ParserTest.java
+++ b/ide/editor/test/unit/src/org/netbeans/modules/editor/url/ParserTest.java
@@ -76,6 +76,8 @@ public class ParserTest {
         performTest("    
http://hudson.gotdns.com/wiki/display/HUDSON/Structured+Form+Submission(v=vs.85).aspx\n",
 4,89);
         performTest("    http://hudson.gotdns.com/wiki/display/#!/api/dd13\n";, 
4,53);
         performTest("    
file:///C:/CodeSourceryG++Lite/share/doc/arm-arm-none-eabi/html/getting-started/sec-cs3-startup.html",
 4, 104);
+        // NETBEANS-4593 accept @
+        performTest("    
https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js\n";, 4, 62);
     }
 
     @Test
@@ -143,4 +145,4 @@ public class ParserTest {
         return r;
     }
     
-}
\ No newline at end of file
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to