mirror of
https://github.com/golang/go
synced 2024-09-30 14:18:32 -06:00
0cc1aa72b3
The current URL regexes (including xurls) match links in any part of a string. However, this leads to odd underlining within words which just so happen to have valid domain names as substrings. For example, a comment which contains "reflect.DeepEqual" will match the URL regex as "reflect.de" is a domain name. Ensure that the URLs only match full regex words by adding \b around the expressions. For xurls, this is done by pulling the expression out of Relaxed() and recreating the Regexp. While I'm here, make the non-gopls module expression prefer the longest match, as xurls does. Change-Id: I403db970fa1661c443b0693c03f8dee114f8eaff Reviewed-on: https://go-review.googlesource.com/c/tools/+/240738 Run-TryBot: Rebecca Stambler <rstambler@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> |
||
---|---|---|
.. | ||
analysisinternal | ||
apidiff | ||
event | ||
fakenet | ||
fastwalk | ||
gocommand | ||
gopathwalk | ||
imports | ||
jsonrpc2 | ||
lsp | ||
memoize | ||
packagesinternal | ||
proxydir | ||
span | ||
stack | ||
testenv | ||
tool | ||
typesinternal | ||
xcontext |