]> Cypherpunks repositories - gostls13.git/commitdiff
go/doc: document unicode quoting conversion
authorAgniva De Sarker <agnivade@yahoo.co.in>
Sun, 10 Nov 2019 06:26:15 +0000 (11:56 +0530)
committerRobert Griesemer <gri@golang.org>
Tue, 12 Nov 2019 04:25:02 +0000 (04:25 +0000)
Fixes #30955

Change-Id: I8a2bff5215ddf6c3a80b1e760cb72b0bb9a5e0d3
Reviewed-on: https://go-review.googlesource.com/c/go/+/206122
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/doc/comment.go

index 88be45bb8fbdc8ef23bd435d181bfb2c21093572..da33f21612feec04ff295fadf4c2b7563686ceb9 100644 (file)
@@ -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,