Commit f270534
fix(terminal): make Ctrl+Click work for URLs ending with a port
FullUrlRegExp's port group used a consuming boundary check [^0-9],
which swallowed the character immediately after the port (newline, space,
or '/') into the captured URL string. For URLs like 'http://localhost:8000'
at end of a line, the capture became 'http://localhost:8000\n' and
QUrl::StrictMode rejected it, so Ctrl+Click silently did nothing while
the hover underline still showed.
Replace [^0-9] with the non-consuming negative lookahead (?![0-9]).
The boundary character is now asserted but not consumed, so the captured
URL stays clean and QUrl accepts it. This also fixes a related issue
where 'http://localhost:8000/path' was truncated to 'http://localhost:8000/'
because the consumed '/' broke the optional path group.
Verified against: http://localhost:8000 (was broken), http://localhost:8000/
(works), http://localhost:8000/path (was truncated), http://www.baidu.com:4443/,
and invalid port boundary http://localhost:80000 (still rejected as expected).1 parent e7bcf81 commit f270534
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
526 | 529 | | |
527 | | - | |
| 530 | + | |
528 | 531 | | |
529 | 532 | | |
530 | 533 | | |
| |||
0 commit comments