]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/xml: document HTMLAutoClose and HTMLEntity more
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 2 Aug 2018 20:42:00 +0000 (20:42 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 2 Aug 2018 20:47:47 +0000 (20:47 +0000)
They didn't even have public types, which made them pretty mysterious.

Give them types and reference the Decoder, which uses them.

Also, refer them qualified by their package name in the examples, as
we usually do in example*.go files, which usually use package foo_test
specifically so we can show the package names along with the symbols.

Change-Id: I50ebbbf43778c1627bfa526f8824f52c7953454f
Reviewed-on: https://go-review.googlesource.com/127663
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/encoding/xml/xml.go

index bc1a658bc59417d8e877a28ae8a1f3073d7de8e0..ca059440a1b8ed7be9585c1c8947a0d82d31f7f5 100644 (file)
@@ -168,8 +168,8 @@ type Decoder struct {
        // Setting:
        //
        //      d.Strict = false
-       //      d.AutoClose = HTMLAutoClose
-       //      d.Entity = HTMLEntity
+       //      d.AutoClose = xml.HTMLAutoClose
+       //      d.Entity = xml.HTMLEntity
        //
        // creates a parser that can handle typical HTML.
        //
@@ -1581,7 +1581,9 @@ var second = &unicode.RangeTable{
 
 // HTMLEntity is an entity map containing translations for the
 // standard HTML entity characters.
-var HTMLEntity = htmlEntity
+//
+// See the Decoder.Strict and Decoder.Entity fields' documentation.
+var HTMLEntity map[string]string = htmlEntity
 
 var htmlEntity = map[string]string{
        /*
@@ -1848,7 +1850,9 @@ var htmlEntity = map[string]string{
 
 // HTMLAutoClose is the set of HTML elements that
 // should be considered to close automatically.
-var HTMLAutoClose = htmlAutoClose
+//
+// See the Decoder.Strict and Decoder.Entity fields' documentation.
+var HTMLAutoClose []string = htmlAutoClose
 
 var htmlAutoClose = []string{
        /*