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/comment: support links in lists in comments #53610

Closed
golightlyb opened this issue Jun 29, 2022 · 2 comments
Closed

go/doc/comment: support links in lists in comments #53610

golightlyb opened this issue Jun 29, 2022 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@golightlyb
Copy link
Contributor

The proposed (#51082) new go doc comment additions supports lists, links, and doc links.

I feel its implied by the proposal that lists, because they can contain multiple paragraphs, should be able to contain links and doclinks. However, the current implementation of go/doc/comment does not support this, and treats lists as paragraphs of plain text.

This is how it would look with a list containing a doc link:

//  - Do this, or...
//  - Use [encoding/json.Marshal]

With a list containing a link:

//  - Do this, or...
//  - See [RFC]
//
// [RFC]: https://datatracker.ietf.org/doc/html/rfc2616

With a list containing a link, in a weird embedded link format, that also works (but perhaps shouldn't?)

//  - Do this, or...
//  - See [RFC], or...
//
//    [RFC]: https://datatracker.ietf.org/doc/html/rfc2616
//  - Something else

See pull request imminently

@gopherbot
Copy link

Change https://go.dev/cl/415174 mentions this issue: go/doc/comment: support links in lists in comments

@ianlancetaylor
Copy link
Contributor

CC @rsc

@dmitshur dmitshur added this to the Go1.19 milestone Jun 30, 2022
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed Proposal labels Jun 30, 2022
jproberts pushed a commit to jproberts/go that referenced this issue Aug 10, 2022
The proposed (golang#51082) new go doc comment additions supports lists,
links, and doc links, but does not support links and doc links inside
lists, so implemnent this.

Fixes golang#53610

Change-Id: I4fa17d204fc9efa8f3633133e4a49e56cf1aa9bc
Reviewed-on: https://go-review.googlesource.com/c/go/+/415174
Reviewed-by: Ben Golightly <golightly.ben@googlemail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
@golang golang locked and limited conversation to collaborators Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants