From 36dceac56c467033648590dd7e6ea100e1f824a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Aug 2023 06:39:14 +0000 Subject: [PATCH] [chore]: Bump github.com/yuin/goldmark from 1.5.5 to 1.5.6 (#2140) --- go.mod | 2 +- go.sum | 4 +- vendor/github.com/yuin/goldmark/.golangci.yml | 105 + vendor/github.com/yuin/goldmark/Makefile | 5 +- vendor/github.com/yuin/goldmark/ast/ast.go | 12 +- vendor/github.com/yuin/goldmark/ast/block.go | 24 +- vendor/github.com/yuin/goldmark/ast/inline.go | 17 +- .../yuin/goldmark/extension/ast/footnote.go | 2 +- .../yuin/goldmark/extension/ast/table.go | 5 +- .../github.com/yuin/goldmark/extension/cjk.go | 1 + .../goldmark/extension/definition_list.go | 12 +- .../yuin/goldmark/extension/footnote.go | 24 +- .../yuin/goldmark/extension/linkify.go | 16 +- .../yuin/goldmark/extension/package.go | 2 + .../yuin/goldmark/extension/strikethrough.go | 3 +- .../yuin/goldmark/extension/table.go | 26 +- .../yuin/goldmark/extension/tasklist.go | 14 +- .../yuin/goldmark/extension/typographer.go | 47 +- .../yuin/goldmark/parser/attribute.go | 11 +- .../yuin/goldmark/parser/atx_heading.go | 6 +- .../yuin/goldmark/parser/delimiter.go | 6 +- .../yuin/goldmark/parser/html_block.go | 9 +- .../github.com/yuin/goldmark/parser/link.go | 3 +- .../github.com/yuin/goldmark/parser/list.go | 8 +- .../github.com/yuin/goldmark/parser/parser.go | 20 +- .../yuin/goldmark/parser/raw_html.go | 7 +- .../yuin/goldmark/parser/setext_headings.go | 2 +- .../yuin/goldmark/renderer/html/html.go | 34 +- .../yuin/goldmark/renderer/renderer.go | 4 +- .../github.com/yuin/goldmark/text/package.go | 2 + .../github.com/yuin/goldmark/text/reader.go | 6 +- .../yuin/goldmark/util/html5entities.go | 3 +- .../goldmark/util/unicode_case_folding.go | 3063 +++++++++-------- vendor/github.com/yuin/goldmark/util/util.go | 57 +- .../yuin/goldmark/util/util_safe.go | 1 + .../yuin/goldmark/util/util_unsafe.go | 1 + vendor/modules.txt | 2 +- 37 files changed, 1872 insertions(+), 1694 deletions(-) create mode 100644 vendor/github.com/yuin/goldmark/.golangci.yml create mode 100644 vendor/github.com/yuin/goldmark/extension/package.go create mode 100644 vendor/github.com/yuin/goldmark/text/package.go diff --git a/go.mod b/go.mod index afde2258e..a00ac3b78 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,7 @@ require ( github.com/uptrace/bun/dialect/sqlitedialect v1.1.14 github.com/uptrace/bun/extra/bunotel v1.1.14 github.com/wagslane/go-password-validator v0.3.0 - github.com/yuin/goldmark v1.5.5 + github.com/yuin/goldmark v1.5.6 go.opentelemetry.io/otel v1.16.0 go.opentelemetry.io/otel/exporters/jaeger v1.16.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.16.0 diff --git a/go.sum b/go.sum index 37ee19e41..506108244 100644 --- a/go.sum +++ b/go.sum @@ -635,8 +635,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.5.5 h1:IJznPe8wOzfIKETmMkd06F8nXkmlhaHqFRM9l1hAGsU= -github.com/yuin/goldmark v1.5.5/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/goldmark v1.5.6 h1:COmQAWTCcGetChm3Ig7G/t8AFAN00t+o8Mt4cf7JpwA= +github.com/yuin/goldmark v1.5.6/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/blake3 v0.2.1/go.mod h1:TSQ0KjMH+pht+bRyvVooJ1rBpvvngSGaPISafq9MxJk= github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4= diff --git a/vendor/github.com/yuin/goldmark/.golangci.yml b/vendor/github.com/yuin/goldmark/.golangci.yml new file mode 100644 index 000000000..28d8b9c9a --- /dev/null +++ b/vendor/github.com/yuin/goldmark/.golangci.yml @@ -0,0 +1,105 @@ +run: + deadline: 10m + +issues: + exclude-use-default: false + exclude-rules: + - path: _test.go + linters: + - errcheck + - lll + exclude: + - "Package util" + +linters: + disable-all: true + enable: + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - typecheck + - unused + - gofmt + - godot + - makezero + - misspell + - revive + - wastedassign + - lll + +linters-settings: + revive: + severity: "warning" + confidence: 0.8 + rules: + - name: blank-imports + severity: warning + disabled: false + - name: context-as-argument + severity: warning + disabled: false + - name: context-keys-type + severity: warning + disabled: false + - name: dot-imports + severity: warning + disabled: false + - name: error-return + severity: warning + disabled: false + - name: error-strings + severity: warning + disabled: false + - name: error-naming + severity: warning + disabled: false + - name: exported + severity: warning + disabled: false + - name: increment-decrement + severity: warning + disabled: false + - name: var-naming + severity: warning + disabled: false + - name: var-declaration + severity: warning + disabled: false + - name: package-comments + severity: warning + disabled: false + - name: range + severity: warning + disabled: false + - name: receiver-naming + severity: warning + disabled: false + - name: time-naming + severity: warning + disabled: false + - name: unexported-return + severity: warning + disabled: false + - name: indent-error-flow + severity: warning + disabled: false + - name: errorf + severity: warning + disabled: false + - name: empty-block + severity: warning + disabled: true + - name: superfluous-else + severity: warning + disabled: false + - name: unused-parameter + severity: warning + disabled: true + - name: unreachable-code + severity: warning + disabled: false + - name: redefines-builtin-id + severity: warning + disabled: false diff --git a/vendor/github.com/yuin/goldmark/Makefile b/vendor/github.com/yuin/goldmark/Makefile index e34fe866a..b0bb05293 100644 --- a/vendor/github.com/yuin/goldmark/Makefile +++ b/vendor/github.com/yuin/goldmark/Makefile @@ -1,4 +1,7 @@ -.PHONY: test fuzz +.PHONY: test fuzz lint + +lint: + golangci-lint run -c .golangci.yml ./... test: go test -coverprofile=profile.out -coverpkg=github.com/yuin/goldmark,github.com/yuin/goldmark/ast,github.com/yuin/goldmark/extension,github.com/yuin/goldmark/extension/ast,github.com/yuin/goldmark/parser,github.com/yuin/goldmark/renderer,github.com/yuin/goldmark/renderer/html,github.com/yuin/goldmark/text,github.com/yuin/goldmark/util ./... diff --git a/vendor/github.com/yuin/goldmark/ast/ast.go b/vendor/github.com/yuin/goldmark/ast/ast.go index 3719ebbd8..67bb0da56 100644 --- a/vendor/github.com/yuin/goldmark/ast/ast.go +++ b/vendor/github.com/yuin/goldmark/ast/ast.go @@ -39,7 +39,7 @@ func NewNodeKind(name string) NodeKind { return kindMax } -// An Attribute is an attribute of the Node +// An Attribute is an attribute of the Node. type Attribute struct { Name []byte Value interface{} @@ -248,7 +248,7 @@ func (n *BaseNode) RemoveChildren(self Node) { n.childCount = 0 } -// SortChildren implements Node.SortChildren +// SortChildren implements Node.SortChildren. func (n *BaseNode) SortChildren(comparator func(n1, n2 Node) int) { var sorted Node current := n.firstChild @@ -358,7 +358,7 @@ func (n *BaseNode) InsertBefore(self, v1, insertee Node) { } } -// OwnerDocument implements Node.OwnerDocument +// OwnerDocument implements Node.OwnerDocument. func (n *BaseNode) OwnerDocument() *Document { d := n.Parent() for { @@ -399,7 +399,7 @@ func (n *BaseNode) SetAttribute(name []byte, value interface{}) { n.attributes = append(n.attributes, Attribute{name, value}) } -// SetAttributeString implements Node.SetAttributeString +// SetAttributeString implements Node.SetAttributeString. func (n *BaseNode) SetAttributeString(name string, value interface{}) { n.SetAttribute(util.StringToReadOnlyBytes(name), value) } @@ -422,12 +422,12 @@ func (n *BaseNode) AttributeString(s string) (interface{}, bool) { return n.Attribute(util.StringToReadOnlyBytes(s)) } -// Attributes implements Node.Attributes +// Attributes implements Node.Attributes. func (n *BaseNode) Attributes() []Attribute { return n.attributes } -// RemoveAttributes implements Node.RemoveAttributes +// RemoveAttributes implements Node.RemoveAttributes. func (n *BaseNode) RemoveAttributes() { n.attributes = nil } diff --git a/vendor/github.com/yuin/goldmark/ast/block.go b/vendor/github.com/yuin/goldmark/ast/block.go index 02e9d5190..c5d4738e6 100644 --- a/vendor/github.com/yuin/goldmark/ast/block.go +++ b/vendor/github.com/yuin/goldmark/ast/block.go @@ -14,12 +14,12 @@ type BaseBlock struct { lines *textm.Segments } -// Type implements Node.Type +// Type implements Node.Type. func (b *BaseBlock) Type() NodeType { return TypeBlock } -// IsRaw implements Node.IsRaw +// IsRaw implements Node.IsRaw. func (b *BaseBlock) IsRaw() bool { return false } @@ -34,7 +34,7 @@ func (b *BaseBlock) SetBlankPreviousLines(v bool) { b.blankPreviousLines = v } -// Lines implements Node.Lines +// Lines implements Node.Lines. func (b *BaseBlock) Lines() *textm.Segments { if b.lines == nil { b.lines = textm.NewSegments() @@ -42,7 +42,7 @@ func (b *BaseBlock) Lines() *textm.Segments { return b.lines } -// SetLines implements Node.SetLines +// SetLines implements Node.SetLines. func (b *BaseBlock) SetLines(v *textm.Segments) { b.lines = v } @@ -72,7 +72,7 @@ func (n *Document) Kind() NodeKind { return KindDocument } -// OwnerDocument implements Node.OwnerDocument +// OwnerDocument implements Node.OwnerDocument. func (n *Document) OwnerDocument() *Document { return n } @@ -431,19 +431,19 @@ func NewListItem(offset int) *ListItem { type HTMLBlockType int const ( - // HTMLBlockType1 represents type 1 html blocks + // HTMLBlockType1 represents type 1 html blocks. HTMLBlockType1 HTMLBlockType = iota + 1 - // HTMLBlockType2 represents type 2 html blocks + // HTMLBlockType2 represents type 2 html blocks. HTMLBlockType2 - // HTMLBlockType3 represents type 3 html blocks + // HTMLBlockType3 represents type 3 html blocks. HTMLBlockType3 - // HTMLBlockType4 represents type 4 html blocks + // HTMLBlockType4 represents type 4 html blocks. HTMLBlockType4 - // HTMLBlockType5 represents type 5 html blocks + // HTMLBlockType5 represents type 5 html blocks. HTMLBlockType5 - // HTMLBlockType6 represents type 6 html blocks + // HTMLBlockType6 represents type 6 html blocks. HTMLBlockType6 - // HTMLBlockType7 represents type 7 html blocks + // HTMLBlockType7 represents type 7 html blocks. HTMLBlockType7 ) diff --git a/vendor/github.com/yuin/goldmark/ast/inline.go b/vendor/github.com/yuin/goldmark/ast/inline.go index 7da098f25..7e4c51f23 100644 --- a/vendor/github.com/yuin/goldmark/ast/inline.go +++ b/vendor/github.com/yuin/goldmark/ast/inline.go @@ -13,12 +13,12 @@ type BaseInline struct { BaseNode } -// Type implements Node.Type +// Type implements Node.Type. func (b *BaseInline) Type() NodeType { return TypeInline } -// IsRaw implements Node.IsRaw +// IsRaw implements Node.IsRaw. func (b *BaseInline) IsRaw() bool { return false } @@ -33,12 +33,12 @@ func (b *BaseInline) SetBlankPreviousLines(v bool) { panic("can not call with inline nodes.") } -// Lines implements Node.Lines +// Lines implements Node.Lines. func (b *BaseInline) Lines() *textm.Segments { panic("can not call with inline nodes.") } -// SetLines implements Node.SetLines +// SetLines implements Node.SetLines. func (b *BaseInline) SetLines(v *textm.Segments) { panic("can not call with inline nodes.") } @@ -132,7 +132,8 @@ func (n *Text) Merge(node Node, source []byte) bool { if !ok { return false } - if n.Segment.Stop != t.Segment.Start || t.Segment.Padding != 0 || source[n.Segment.Stop-1] == '\n' || t.IsRaw() != n.IsRaw() { + if n.Segment.Stop != t.Segment.Start || t.Segment.Padding != 0 || + source[n.Segment.Stop-1] == '\n' || t.IsRaw() != n.IsRaw() { return false } n.Segment.Stop = t.Segment.Stop @@ -214,7 +215,7 @@ func MergeOrReplaceTextSegment(parent Node, n Node, s textm.Segment) { } } -// A String struct is a textual content that has a concrete value +// A String struct is a textual content that has a concrete value. type String struct { BaseInline @@ -305,7 +306,7 @@ func (n *CodeSpan) IsBlank(source []byte) bool { return true } -// Dump implements Node.Dump +// Dump implements Node.Dump. func (n *CodeSpan) Dump(source []byte, level int) { DumpHelper(n, source, level, nil, nil) } @@ -467,7 +468,7 @@ type AutoLink struct { // Inline implements Inline.Inline. func (n *AutoLink) Inline() {} -// Dump implements Node.Dump +// Dump implements Node.Dump. func (n *AutoLink) Dump(source []byte, level int) { segment := n.value.Segment m := map[string]string{ diff --git a/vendor/github.com/yuin/goldmark/extension/ast/footnote.go b/vendor/github.com/yuin/goldmark/extension/ast/footnote.go index 97fea4403..b24eafe67 100644 --- a/vendor/github.com/yuin/goldmark/extension/ast/footnote.go +++ b/vendor/github.com/yuin/goldmark/extension/ast/footnote.go @@ -88,7 +88,7 @@ type Footnote struct { func (n *Footnote) Dump(source []byte, level int) { m := map[string]string{} m["Index"] = fmt.Sprintf("%v", n.Index) - m["Ref"] = fmt.Sprintf("%s", n.Ref) + m["Ref"] = string(n.Ref) gast.DumpHelper(n, source, level, m, nil) } diff --git a/vendor/github.com/yuin/goldmark/extension/ast/table.go b/vendor/github.com/yuin/goldmark/extension/ast/table.go index e9eff3ceb..4142e33c7 100644 --- a/vendor/github.com/yuin/goldmark/extension/ast/table.go +++ b/vendor/github.com/yuin/goldmark/extension/ast/table.go @@ -2,8 +2,9 @@ import ( "fmt" - gast "github.com/yuin/goldmark/ast" "strings" + + gast "github.com/yuin/goldmark/ast" ) // Alignment is a text alignment of table cells. @@ -45,7 +46,7 @@ type Table struct { Alignments []Alignment } -// Dump implements Node.Dump +// Dump implements Node.Dump. func (n *Table) Dump(source []byte, level int) { gast.DumpHelper(n, source, level, nil, func(level int) { indent := strings.Repeat(" ", level) diff --git a/vendor/github.com/yuin/goldmark/extension/cjk.go b/vendor/github.com/yuin/goldmark/extension/cjk.go index cb6f9553d..14bcde1e1 100644 --- a/vendor/github.com/yuin/goldmark/extension/cjk.go +++ b/vendor/github.com/yuin/goldmark/extension/cjk.go @@ -29,6 +29,7 @@ type cjk struct { EscapedSpace bool } +// CJK is a goldmark extension that provides functionalities for CJK languages. var CJK = NewCJK(WithEastAsianLineBreaks(), WithEscapedSpace()) // NewCJK returns a new extension with given options. diff --git a/vendor/github.com/yuin/goldmark/extension/definition_list.go b/vendor/github.com/yuin/goldmark/extension/definition_list.go index d2f5fecbe..3e64dcf7f 100644 --- a/vendor/github.com/yuin/goldmark/extension/definition_list.go +++ b/vendor/github.com/yuin/goldmark/extension/definition_list.go @@ -113,7 +113,8 @@ func (b *definitionDescriptionParser) Trigger() []byte { return []byte{':'} } -func (b *definitionDescriptionParser) Open(parent gast.Node, reader text.Reader, pc parser.Context) (gast.Node, parser.State) { +func (b *definitionDescriptionParser) Open( + parent gast.Node, reader text.Reader, pc parser.Context) (gast.Node, parser.State) { line, _ := reader.PeekLine() pos := pc.BlockOffset() indent := pc.BlockIndent() @@ -199,7 +200,8 @@ func (r *DefinitionListHTMLRenderer) RegisterFuncs(reg renderer.NodeRendererFunc // DefinitionListAttributeFilter defines attribute names which dl elements can have. var DefinitionListAttributeFilter = html.GlobalAttributeFilter -func (r *DefinitionListHTMLRenderer) renderDefinitionList(w util.BufWriter, source []byte, n gast.Node, entering bool) (gast.WalkStatus, error) { +func (r *DefinitionListHTMLRenderer) renderDefinitionList( + w util.BufWriter, source []byte, n gast.Node, entering bool) (gast.WalkStatus, error) { if entering { if n.Attributes() != nil { _, _ = w.WriteString("
= 0x41 && c <= 0x5a {
// A-Z to a-z
cob.Write(v[n:i])
- cob.WriteByte(c + 32)
+ _ = cob.WriteByte(c + 32)
n = i + 1
}
continue
@@ -521,7 +522,7 @@ func ToLinkReference(v []byte) string {
return string(ReplaceSpaces(v, ' '))
}
-var htmlEscapeTable = [256][]byte{nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, []byte("""), nil, nil, nil, []byte("&"), nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, []byte("<"), nil, []byte(">"), nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil}
+var htmlEscapeTable = [256][]byte{nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, []byte("""), nil, nil, nil, []byte("&"), nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, []byte("<"), nil, []byte(">"), nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil} //nolint:golint,lll
// EscapeHTMLByte returns HTML escaped bytes if the given byte should be escaped,
// otherwise nil.
@@ -557,7 +558,7 @@ func UnescapePunctuations(source []byte) []byte {
c := source[i]
if i < limit-1 && c == '\\' && IsPunct(source[i+1]) {
cob.Write(source[n:i])
- cob.WriteByte(source[i+1])
+ _ = cob.WriteByte(source[i+1])
i += 2
n = i
continue
@@ -573,9 +574,9 @@ func UnescapePunctuations(source []byte) []byte {
// ResolveNumericReferences resolve numeric references like 'Ӓ" .
func ResolveNumericReferences(source []byte) []byte {
cob := NewCopyOnWriteBuffer(source)
- buf := make([]byte, 6, 6)
+ buf := make([]byte, 6)
limit := len(source)
- ok := false
+ var ok bool
n := 0
for i := 0; i < limit; i++ {
if source[i] == '&' {
@@ -625,7 +626,7 @@ func ResolveNumericReferences(source []byte) []byte {
func ResolveEntityNames(source []byte) []byte {
cob := NewCopyOnWriteBuffer(source)
limit := len(source)
- ok := false
+ var ok bool
n := 0
for i := 0; i < limit; i++ {
if source[i] == '&' {
@@ -658,9 +659,9 @@ func ResolveEntityNames(source []byte) []byte {
// URLEscape escape the given URL.
// If resolveReference is set true:
-// 1. unescape punctuations
-// 2. resolve numeric references
-// 3. resolve entity references
+// 1. unescape punctuations
+// 2. resolve numeric references
+// 3. resolve entity references
//
// URL encoded values (%xx) are kept as is.
func URLEscape(v []byte, resolveReference bool) []byte {
@@ -750,7 +751,7 @@ func FindURLIndex(b []byte) int {
return i
}
-var emailDomainRegexp = regexp.MustCompile(`^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*`)
+var emailDomainRegexp = regexp.MustCompile(`^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*`) //nolint:golint,lll
// FindEmailIndex returns a stop index value if the given bytes seem an email address.
func FindEmailIndex(b []byte) int {
@@ -781,18 +782,19 @@ func FindEmailIndex(b []byte) int {
var spaces = []byte(" \t\n\x0b\x0c\x0d")
-var spaceTable = [256]int8{0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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[256]uint8{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} //nolint:golint,lll
// UTF8Len returns a byte length of the utf-8 character.
func UTF8Len(b byte) int8 {
@@ -836,11 +838,18 @@ func IsAlphaNumeric(c byte) bool {
// IsEastAsianWideRune returns trhe if the given rune is an east asian wide character, otherwise false.
func IsEastAsianWideRune(r rune) bool {
+ // https://en.wikipedia.org/wiki/CJK_Symbols_and_Punctuation
+ var CJKSymbolsAndPunctuation = &unicode.RangeTable{
+ R16: []unicode.Range16{
+ {0x3000, 0x303F, 1},
+ },
+ }
return unicode.Is(unicode.Hiragana, r) ||
unicode.Is(unicode.Katakana, r) ||
unicode.Is(unicode.Han, r) ||
unicode.Is(unicode.Lm, r) ||
- unicode.Is(unicode.Hangul, r)
+ unicode.Is(unicode.Hangul, r) ||
+ unicode.Is(CJKSymbolsAndPunctuation, r)
}
// A BufWriter is a subset of the bufio.Writer .
@@ -862,7 +871,7 @@ type PrioritizedValue struct {
Priority int
}
-// PrioritizedSlice is a slice of the PrioritizedValues
+// PrioritizedSlice is a slice of the PrioritizedValues.
type PrioritizedSlice []PrioritizedValue
// Sort sorts the PrioritizedSlice in ascending order.
@@ -977,7 +986,7 @@ func (s *bytesFilter) Contains(b []byte) bool {
}
h := bytesHash(b) % uint64(len(s.slots))
slot := s.slots[h]
- if slot == nil || len(slot) == 0 {
+ if len(slot) == 0 {
return false
}
for _, element := range slot {
diff --git a/vendor/github.com/yuin/goldmark/util/util_safe.go b/vendor/github.com/yuin/goldmark/util/util_safe.go
index 507a9d029..2f6a3feee 100644
--- a/vendor/github.com/yuin/goldmark/util/util_safe.go
+++ b/vendor/github.com/yuin/goldmark/util/util_safe.go
@@ -1,3 +1,4 @@
+//go:build appengine || js
// +build appengine js
package util
diff --git a/vendor/github.com/yuin/goldmark/util/util_unsafe.go b/vendor/github.com/yuin/goldmark/util/util_unsafe.go
index d09881104..840007a2a 100644
--- a/vendor/github.com/yuin/goldmark/util/util_unsafe.go
+++ b/vendor/github.com/yuin/goldmark/util/util_unsafe.go
@@ -1,3 +1,4 @@
+//go:build !appengine && !js
// +build !appengine,!js
package util
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 0ce4e52bb..b5de86caf 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -736,7 +736,7 @@ github.com/vmihailenco/tagparser/v2/internal/parser
# github.com/wagslane/go-password-validator v0.3.0
## explicit; go 1.16
github.com/wagslane/go-password-validator
-# github.com/yuin/goldmark v1.5.5
+# github.com/yuin/goldmark v1.5.6
## explicit; go 1.18
github.com/yuin/goldmark
github.com/yuin/goldmark/ast