diff options
author | 2023-08-21 06:39:14 +0000 | |
---|---|---|
committer | 2023-08-21 06:39:14 +0000 | |
commit | 36dceac56c467033648590dd7e6ea100e1f824a2 (patch) | |
tree | 54d1d6451c63785278ad5c1a6331a1d38fe2363e /vendor/github.com/yuin/goldmark/parser/attribute.go | |
parent | [feature/bugfix] Probe S3 storage for CSP uri, add config flag for extra URIs... (diff) | |
download | gotosocial-36dceac56c467033648590dd7e6ea100e1f824a2.tar.xz |
[chore]: Bump github.com/yuin/goldmark from 1.5.5 to 1.5.6 (#2140)
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 } |