Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/doc: ToHTML fails on wikipedia ( ) urls #5043

Closed
dgryski opened this issue Mar 13, 2013 · 11 comments
Closed

go/doc: ToHTML fails on wikipedia ( ) urls #5043

dgryski opened this issue Mar 13, 2013 · 11 comments
Milestone

Comments

@dgryski
Copy link
Contributor

dgryski commented Mar 13, 2013

If possible, include a link to a program on play.golang.org.
1. Calling go/doc.ToHTML on text containing a URL with ()s fails to turn the entire URL
into a link.
2. http://play.golang.org/p/nEooaMLM8x

What is the expected output?
The wikipedia link to Camellia_(cipher) should be entirely highlighted.  

What do you see instead?
Instead, only the link to up the underscore is turned into a link.

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g.

Which operating system are you using?
Linux.


Which version are you using?  (run 'go version')
go version devel +2bd4d868a758 Wed Mar 13 02:40:56 2013 +0800 linux/amd64

Please provide any additional information below.
This makes ugly links on godoc.org .
@rsc
Copy link
Contributor

rsc commented Mar 13, 2013

Comment 1:

How awful. Let's leave this until after Go 1.1.
We don't want to grab the closing ) in (http://golang.org) so I guess the link finder
will have to count parentheses. Ugh.
The workaround is to use %28 and %29 instead.

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 2:

Labels changed: added go1.2maybe.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 3:

Labels changed: added feature.

@robpike
Copy link
Contributor

robpike commented Aug 29, 2013

Comment 4:

Not for 1.2.

@robpike
Copy link
Contributor

robpike commented Aug 29, 2013

Comment 5:

Labels changed: removed go1.2maybe.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 6:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 7:

Labels changed: removed feature.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 8:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 9:

Labels changed: added repo-main.

@griesemer
Copy link
Contributor

Comment 10:

Pending CL: https://golang.org/cl/85610043

Labels changed: added release-go1.3, removed release-none.

Owner changed to @griesemer.

Status changed to Started.

@griesemer
Copy link
Contributor

Comment 11:

This issue was closed by revision 9610b61.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
gopherbot pushed a commit that referenced this issue Dec 14, 2018
To fix #5043, we added logic to allow balanced pairs of parenthesis
so that we could match URLs like:
	http://example.com/some_resource(foo)

Howewer, such logic breaks when parsing something like the following:
	art by [https://example.com/person][Person Name]].
such that the following is considered the link:
	https://example.com/person][Person

Since the logic added in #5043 was just a heuristic, we adjust
the heuristic that in addition to requiring balanced pairs,
the first parenthesis must be an opening one.

For further robustness, we apply this heuristic to
parenthesis, braces, and brackets.

Fixes #22285

Change-Id: I23b728a644e35ce3995b05a79129cad2c1e3b1ce
Reviewed-on: https://go-review.googlesource.com/c/94876
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants