aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAgniva De Sarker <agnivade@yahoo.co.in>2019-11-10 11:56:15 +0530
committerRobert Griesemer <gri@golang.org>2019-11-12 04:25:02 +0000
commitb60c7a5c7f50fc75ddecb7f1dea6c2e47a12b42c (patch)
tree3e265d5b4fc22e1ca2663b6dffd6674feb8e232e /src
parent72e043e48bf47ce03229b011d2468f46081055ad (diff)
downloadgo-b60c7a5c7f50fc75ddecb7f1dea6c2e47a12b42c.tar.xz
go/doc: document unicode quoting conversion
Fixes #30955 Change-Id: I8a2bff5215ddf6c3a80b1e760cb72b0bb9a5e0d3 Reviewed-on: https://go-review.googlesource.com/c/go/+/206122 Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/go/doc/comment.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/go/doc/comment.go b/src/go/doc/comment.go
index 88be45bb8f..da33f21612 100644
--- a/src/go/doc/comment.go
+++ b/src/go/doc/comment.go
@@ -300,6 +300,9 @@ func anchorID(line string) string {
// in the words map, the link is taken from the map (if the corresponding map
// value is the empty string, the URL is not converted into a link).
//
+// A pair of (consecutive) backticks (`) is converted to a unicode left quote (“), and a pair of (consecutive)
+// single quotes (') is converted to a unicode right quote (”).
+//
// Go identifiers that appear in the words map are italicized; if the corresponding
// map value is not the empty string, it is considered a URL and the word is converted
// into a link.
@@ -417,6 +420,9 @@ func blocks(text string) []block {
// It wraps paragraphs of text to width or fewer Unicode code points
// and then prefixes each line with the indent. In preformatted sections
// (such as program text), it prefixes each non-blank line with preIndent.
+//
+// A pair of (consecutive) backticks (`) is converted to a unicode left quote (“), and a pair of (consecutive)
+// single quotes (') is converted to a unicode right quote (”).
func ToText(w io.Writer, text string, indent, preIndent string, width int) {
l := lineWrapper{
out: w,