This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 223515
Collapse All | Expand All

(-)a/editor/src/org/netbeans/modules/editor/url/Parser.java (-2 / +20 lines)
Lines 60-65 Link Here
60
        HTTPS,
60
        HTTPS,
61
        HTTPC, // // (ht|f)tp(s?)
61
        HTTPC, // // (ht|f)tp(s?)
62
        HTTPCS, // (ht|f)tp(s?):/
62
        HTTPCS, // (ht|f)tp(s?):/
63
        FI,
64
        FIL,
65
        FILE,
63
        END // (ht|f)tp(s?)://
66
        END // (ht|f)tp(s?)://
64
    }
67
    }
65
68
Lines 121-126 Link Here
121
                        continue OUTER;
124
                        continue OUTER;
122
                    }
125
                    }
123
                    break;
126
                    break;
127
                case 'i': //NOI18N
128
                    if (state == STATE.F) {
129
                        state = STATE.FI;
130
                        continue OUTER;
131
                    }
132
                case 'l': //NOI18N
133
                    if (state == STATE.FI) {
134
                        state = STATE.FIL;
135
                        continue OUTER;
136
                    }
137
                case 'e': //NOI18N
138
                    if (state == STATE.FIL) {
139
                        state = STATE.FILE;
140
                        continue OUTER;
141
                    }
124
                case 'p': //NOI18N
142
                case 'p': //NOI18N
125
                    if (state == STATE.HTT_FT) {
143
                    if (state == STATE.HTT_FT) {
126
                        state = STATE.HTTP_FTP;
144
                        state = STATE.HTTP_FTP;
Lines 134-140 Link Here
134
                    }
152
                    }
135
                    break;
153
                    break;
136
                case ':': //NOI18N
154
                case ':': //NOI18N
137
                    if (state == STATE.HTTP_FTP || state == STATE.HTTPS) {
155
                    if (state == STATE.HTTP_FTP || state == STATE.HTTPS || state == STATE.FILE) {
138
                        state = STATE.HTTPC;
156
                        state = STATE.HTTPC;
139
                        continue OUTER;
157
                        continue OUTER;
140
                    }
158
                    }
Lines 161-167 Link Here
161
        return result;
179
        return result;
162
    }
180
    }
163
    
181
    
164
    private static final Pattern URL_PATTERN = Pattern.compile("(ht|f)tp(s?)://[0-9a-zA-Z/.?%+_~=\\\\&$\\-#,:]*"); //NOI18N
182
    private static final Pattern URL_PATTERN = Pattern.compile("(ht|f)(tp(s?)|ile)://[0-9a-zA-Z/.?%+_~=\\\\&$\\-#,:]*"); //NOI18N
165
183
166
    public static Iterable<int[]> recognizeURLsREBased(CharSequence text) {
184
    public static Iterable<int[]> recognizeURLsREBased(CharSequence text) {
167
        Matcher m = URL_PATTERN.matcher(text);
185
        Matcher m = URL_PATTERN.matcher(text);
(-)a/editor/test/unit/src/org/netbeans/modules/editor/url/ParserTest.java (+1 lines)
Lines 98-103 Link Here
98
        performTest("    http://hudson.gotdns.com/wiki/display/HUDSON/Structured+Form+Submission\n", 4, 75);
98
        performTest("    http://hudson.gotdns.com/wiki/display/HUDSON/Structured+Form+Submission\n", 4, 75);
99
        performTest("    https://hudson.gotdns.com/wiki/display/HUDSON/Structured+Form+Submission\n", 4, 76);
99
        performTest("    https://hudson.gotdns.com/wiki/display/HUDSON/Structured+Form+Submission\n", 4, 76);
100
        performTest("    ht+tp://hudson.gotdns.com/wiki/display/HUDSON/Structured+Form+Submission\n", null);
100
        performTest("    ht+tp://hudson.gotdns.com/wiki/display/HUDSON/Structured+Form+Submission\n", null);
101
        performTest("    file:///C:/CodeSourceryG++Lite/share/doc/arm-arm-none-eabi/html/getting-started/sec-cs3-startup.html", 4, 104);
101
    }
102
    }
102
103
103
    @Test
104
    @Test

Return to bug 223515