diff options
Diffstat (limited to 'vendor/github.com/yuin/goldmark/parser/attribute.go')
-rw-r--r-- | vendor/github.com/yuin/goldmark/parser/attribute.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/vendor/github.com/yuin/goldmark/parser/attribute.go b/vendor/github.com/yuin/goldmark/parser/attribute.go index f86c83610..42985f4f7 100644 --- a/vendor/github.com/yuin/goldmark/parser/attribute.go +++ b/vendor/github.com/yuin/goldmark/parser/attribute.go @@ -12,7 +12,7 @@ import ( var attrNameID = []byte("id") var attrNameClass = []byte("class") -// An Attribute is an attribute of the markdown elements +// An Attribute is an attribute of the markdown elements. type Attribute struct { Name []byte Value interface{} @@ -93,7 +93,8 @@ func parseAttribute(reader text.Reader) (Attribute, bool) { // CommonMark is basically defined for XHTML(even though it is legacy). // So we restrict id characters. for ; i < len(line) && !util.IsSpace(line[i]) && - (!util.IsPunct(line[i]) || line[i] == '_' || line[i] == '-' || line[i] == ':' || line[i] == '.'); i++ { + (!util.IsPunct(line[i]) || line[i] == '_' || + line[i] == '-' || line[i] == ':' || line[i] == '.'); i++ { } name := attrNameClass if c == '#' { @@ -145,7 +146,7 @@ func parseAttributeValue(reader text.Reader) (interface{}, bool) { reader.SkipSpaces() c := reader.Peek() var value interface{} - ok := false + var ok bool switch c { case text.EOF: return Attribute{}, false @@ -244,7 +245,7 @@ func scanAttributeDecimal(reader text.Reader, w io.ByteWriter) { for { c := reader.Peek() if util.IsNumeric(c) { - w.WriteByte(c) + _ = w.WriteByte(c) } else { return } @@ -286,7 +287,7 @@ func parseAttributeNumber(reader text.Reader) (float64, bool) { } scanAttributeDecimal(reader, &buf) } - f, err := strconv.ParseFloat(buf.String(), 10) + f, err := strconv.ParseFloat(buf.String(), 64) if err != nil { return 0, false } |