go/doc: allow : in godoc links
The emphasize function used a complex regexp to find URLs, which truncated some types of URL and did not match others. This has been simplified and adjusted to allow valid punctuation like :: or ! in the path part and :[] in the host part. Comments were added to clarify what this regexp allows. The path part matches query and fragment also so document this. Removed news, telnet, wais, and prospero protocols. Tests were added for: IPV6 URLs URLs surrounded by brackets URLs containing :: URLs containing :;!- in the path In order to allow punctuation and yet preserve current behaviour, URLs are not permitted to end in .,:;?! to allow the use of normal punctuation surrounding URLs in comments. Fixes #18139 Change-Id: I38b2d7a85fe0d171e4bf4aac420f8c2d3ced8a2f Reviewed-on: https://go-review.googlesource.com/37192Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Showing
Please register or sign in to comment