Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
go/doc: Synopsis can return a sentence spanning multiple paragraphs and code blocks #31947
Let "paragraph" mean a block of text separated from other text by a blank line (i.e.,
fmt.Println(doc.Synopsis(`This is a sentence that starts in the first paragraph and it keeps going in the second paragraph and ends in the third paragraph. This is the second sentence.`)) // Output: This is a sentence that starts in the first paragraph and it keeps going in the second paragraph and ends in the third paragraph.
(Playground link: https://play.golang.org/p/hSAetYyxkwa)
Perhaps we should consider changing the logic such that a sentence is not allowed to span multiple paragraphs.
From what I've observed, that is rarely used intentionally, but can happen unintentionally. For example, the current version of the
Sounds good. To make progress on this issue, we should run that experiment and confirm the results are favorable. We should be able to include a corpus with a number of third-party packages in the experiment, in addition to the standard library packages.