MM-37186: Update dependencies (#18604)
* MM-37186: Update dependencies The split client libraries were excluded from being upgraded. See: https://github.com/splitio/go-split-commons/issues/56 https://mattermost.atlassian.net/browse/MM-37186 ```release-note NONE ``` * Ignore staticcheck deprecation warnings ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2898f988fc
Коммит
76d492f9ab
3
vendor/github.com/yuin/goldmark/parser/atx_heading.go
сгенерированный
поставляемый
3
vendor/github.com/yuin/goldmark/parser/atx_heading.go
сгенерированный
поставляемый
@@ -91,6 +91,9 @@ func (b *atxHeadingParser) Open(parent ast.Node, reader text.Reader, pc Context)
|
||||
if i == pos || level > 6 {
|
||||
return nil, NoChildren
|
||||
}
|
||||
if i == len(line) { // alone '#' (without a new line character)
|
||||
return ast.NewHeading(level), NoChildren
|
||||
}
|
||||
l := util.TrimLeftSpaceLength(line[i:])
|
||||
if l == 0 {
|
||||
return nil, NoChildren
|
||||
|
||||
4
vendor/github.com/yuin/goldmark/parser/code_block.go
сгенерированный
поставляемый
4
vendor/github.com/yuin/goldmark/parser/code_block.go
сгенерированный
поставляемый
@@ -31,6 +31,10 @@ func (b *codeBlockParser) Open(parent ast.Node, reader text.Reader, pc Context)
|
||||
node := ast.NewCodeBlock()
|
||||
reader.AdvanceAndSetPadding(pos, padding)
|
||||
_, segment = reader.PeekLine()
|
||||
// if code block line starts with a tab, keep a tab as it is.
|
||||
if segment.Padding != 0 {
|
||||
preserveLeadingTabInCodeBlock(&segment, reader, 0)
|
||||
}
|
||||
node.Lines().Append(segment)
|
||||
reader.Advance(segment.Len() - 1)
|
||||
return node, NoChildren
|
||||
|
||||
13
vendor/github.com/yuin/goldmark/parser/code_span.go
сгенерированный
поставляемый
13
vendor/github.com/yuin/goldmark/parser/code_span.go
сгенерированный
поставляемый
@@ -3,7 +3,6 @@ package parser
|
||||
import (
|
||||
"github.com/yuin/goldmark/ast"
|
||||
"github.com/yuin/goldmark/text"
|
||||
"github.com/yuin/goldmark/util"
|
||||
)
|
||||
|
||||
type codeSpanParser struct {
|
||||
@@ -52,9 +51,7 @@ func (s *codeSpanParser) Parse(parent ast.Node, block text.Reader, pc Context) a
|
||||
}
|
||||
}
|
||||
}
|
||||
if !util.IsBlank(line) {
|
||||
node.AppendChild(node, ast.NewRawTextSegment(segment))
|
||||
}
|
||||
node.AppendChild(node, ast.NewRawTextSegment(segment))
|
||||
block.AdvanceLine()
|
||||
}
|
||||
end:
|
||||
@@ -62,11 +59,11 @@ end:
|
||||
// trim first halfspace and last halfspace
|
||||
segment := node.FirstChild().(*ast.Text).Segment
|
||||
shouldTrimmed := true
|
||||
if !(!segment.IsEmpty() && block.Source()[segment.Start] == ' ') {
|
||||
if !(!segment.IsEmpty() && isSpaceOrNewline(block.Source()[segment.Start])) {
|
||||
shouldTrimmed = false
|
||||
}
|
||||
segment = node.LastChild().(*ast.Text).Segment
|
||||
if !(!segment.IsEmpty() && block.Source()[segment.Stop-1] == ' ') {
|
||||
if !(!segment.IsEmpty() && isSpaceOrNewline(block.Source()[segment.Stop-1])) {
|
||||
shouldTrimmed = false
|
||||
}
|
||||
if shouldTrimmed {
|
||||
@@ -81,3 +78,7 @@ end:
|
||||
}
|
||||
return node
|
||||
}
|
||||
|
||||
func isSpaceOrNewline(c byte) bool {
|
||||
return c == ' ' || c == '\n'
|
||||
}
|
||||
|
||||
7
vendor/github.com/yuin/goldmark/parser/delimiter.go
сгенерированный
поставляемый
7
vendor/github.com/yuin/goldmark/parser/delimiter.go
сгенерированный
поставляемый
@@ -30,11 +30,11 @@ type Delimiter struct {
|
||||
Segment text.Segment
|
||||
|
||||
// CanOpen is set true if this delimiter can open a span for a new node.
|
||||
// See https://spec.commonmark.org/0.29/#can-open-emphasis for details.
|
||||
// See https://spec.commonmark.org/0.30/#can-open-emphasis for details.
|
||||
CanOpen bool
|
||||
|
||||
// CanClose is set true if this delimiter can close a span for a new node.
|
||||
// See https://spec.commonmark.org/0.29/#can-open-emphasis for details.
|
||||
// See https://spec.commonmark.org/0.30/#can-open-emphasis for details.
|
||||
CanClose bool
|
||||
|
||||
// Length is a remaining length of this delimiter.
|
||||
@@ -200,10 +200,11 @@ func ProcessDelimiters(bottom ast.Node, pc Context) {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
next := closer.NextDelimiter
|
||||
if !maybeOpener && !closer.CanOpen {
|
||||
pc.RemoveDelimiter(closer)
|
||||
}
|
||||
closer = closer.NextDelimiter
|
||||
closer = next
|
||||
continue
|
||||
}
|
||||
opener.ConsumeCharacters(consume)
|
||||
|
||||
8
vendor/github.com/yuin/goldmark/parser/fcode_block.go
сгенерированный
поставляемый
8
vendor/github.com/yuin/goldmark/parser/fcode_block.go
сгенерированный
поставляемый
@@ -72,10 +72,6 @@ func (b *fencedCodeBlockParser) Continue(node ast.Node, reader text.Reader, pc C
|
||||
line, segment := reader.PeekLine()
|
||||
fdata := pc.Get(fencedCodeBlockInfoKey).(*fenceData)
|
||||
|
||||
// if code block line starts with a tab, keep a tab as it is.
|
||||
if segment.Padding != 0 {
|
||||
preserveLeadingTabInCodeBlock(&segment, reader, fdata.indent)
|
||||
}
|
||||
w, pos := util.IndentWidth(line, reader.LineOffset())
|
||||
if w < 4 {
|
||||
i := pos
|
||||
@@ -94,6 +90,10 @@ func (b *fencedCodeBlockParser) Continue(node ast.Node, reader text.Reader, pc C
|
||||
pos, padding := util.DedentPositionPadding(line, reader.LineOffset(), segment.Padding, fdata.indent)
|
||||
|
||||
seg := text.NewSegmentPadding(segment.Start+pos, segment.Stop, padding)
|
||||
// if code block line starts with a tab, keep a tab as it is.
|
||||
if padding != 0 {
|
||||
preserveLeadingTabInCodeBlock(&seg, reader, fdata.indent)
|
||||
}
|
||||
node.Lines().Append(seg)
|
||||
reader.AdvanceAndSetPadding(segment.Stop-segment.Start-pos-1, padding)
|
||||
return Continue | NoChildren
|
||||
|
||||
6
vendor/github.com/yuin/goldmark/parser/html_block.go
сгенерированный
поставляемый
6
vendor/github.com/yuin/goldmark/parser/html_block.go
сгенерированный
поставляемый
@@ -76,8 +76,8 @@ var allowedBlockTags = map[string]bool{
|
||||
"ul": true,
|
||||
}
|
||||
|
||||
var htmlBlockType1OpenRegexp = regexp.MustCompile(`(?i)^[ ]{0,3}<(script|pre|style)(?:\s.*|>.*|/>.*|)\n?$`)
|
||||
var htmlBlockType1CloseRegexp = regexp.MustCompile(`(?i)^.*</(?:script|pre|style)>.*`)
|
||||
var htmlBlockType1OpenRegexp = regexp.MustCompile(`(?i)^[ ]{0,3}<(script|pre|style|textarea)(?:\s.*|>.*|/>.*|)\n?$`)
|
||||
var htmlBlockType1CloseRegexp = regexp.MustCompile(`(?i)^.*</(?:script|pre|style|textarea)>.*`)
|
||||
|
||||
var htmlBlockType2OpenRegexp = regexp.MustCompile(`^[ ]{0,3}<!\-\-`)
|
||||
var htmlBlockType2Close = []byte{'-', '-', '>'}
|
||||
@@ -93,7 +93,7 @@ var htmlBlockType5Close = []byte{']', ']', '>'}
|
||||
|
||||
var htmlBlockType6Regexp = regexp.MustCompile(`^[ ]{0,3}</?([a-zA-Z0-9]+)(?:\s.*|>.*|/>.*|)\n?$`)
|
||||
|
||||
var htmlBlockType7Regexp = regexp.MustCompile(`^[ ]{0,3}<(/)?([a-zA-Z0-9\-]+)(` + attributePattern + `*)(:?>|/>)\s*\n?$`)
|
||||
var htmlBlockType7Regexp = regexp.MustCompile(`^[ ]{0,3}<(/)?\s*([a-zA-Z0-9\-]+)(` + attributePattern + `*)\s*(:?>|/>)\s*\n?$`)
|
||||
|
||||
type htmlBlockParser struct {
|
||||
}
|
||||
|
||||
61
vendor/github.com/yuin/goldmark/parser/link.go
сгенерированный
поставляемый
61
vendor/github.com/yuin/goldmark/parser/link.go
сгенерированный
поставляемый
@@ -221,21 +221,33 @@ func (s *linkParser) processLinkLabel(parent ast.Node, link *ast.Link, last *lin
|
||||
}
|
||||
}
|
||||
|
||||
var linkFindClosureOptions text.FindClosureOptions = text.FindClosureOptions{
|
||||
Nesting: false,
|
||||
Newline: true,
|
||||
Advance: true,
|
||||
}
|
||||
|
||||
func (s *linkParser) parseReferenceLink(parent ast.Node, last *linkLabelState, block text.Reader, pc Context) (*ast.Link, bool) {
|
||||
_, orgpos := block.Position()
|
||||
block.Advance(1) // skip '['
|
||||
line, segment := block.PeekLine()
|
||||
endIndex := util.FindClosure(line, '[', ']', false, true)
|
||||
if endIndex < 0 {
|
||||
segments, found := block.FindClosure('[', ']', linkFindClosureOptions)
|
||||
if !found {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
block.Advance(endIndex + 1)
|
||||
ssegment := segment.WithStop(segment.Start + endIndex)
|
||||
maybeReference := block.Value(ssegment)
|
||||
var maybeReference []byte
|
||||
if segments.Len() == 1 { // avoid allocate a new byte slice
|
||||
maybeReference = block.Value(segments.At(0))
|
||||
} else {
|
||||
maybeReference = []byte{}
|
||||
for i := 0; i < segments.Len(); i++ {
|
||||
s := segments.At(i)
|
||||
maybeReference = append(maybeReference, block.Value(s)...)
|
||||
}
|
||||
}
|
||||
if util.IsBlank(maybeReference) { // collapsed reference link
|
||||
ssegment = text.NewSegment(last.Segment.Stop, orgpos.Start-1)
|
||||
maybeReference = block.Value(ssegment)
|
||||
s := text.NewSegment(last.Segment.Stop, orgpos.Start-1)
|
||||
maybeReference = block.Value(s)
|
||||
}
|
||||
|
||||
ref, ok := pc.Reference(util.ToLinkReference(maybeReference))
|
||||
@@ -338,31 +350,20 @@ func parseLinkTitle(block text.Reader) ([]byte, bool) {
|
||||
if opener == '(' {
|
||||
closer = ')'
|
||||
}
|
||||
savedLine, savedPosition := block.Position()
|
||||
var title []byte
|
||||
for i := 0; ; i++ {
|
||||
line, _ := block.PeekLine()
|
||||
if line == nil {
|
||||
block.SetPosition(savedLine, savedPosition)
|
||||
return nil, false
|
||||
block.Advance(1)
|
||||
segments, found := block.FindClosure(opener, closer, linkFindClosureOptions)
|
||||
if found {
|
||||
if segments.Len() == 1 {
|
||||
return block.Value(segments.At(0)), true
|
||||
}
|
||||
offset := 0
|
||||
if i == 0 {
|
||||
offset = 1
|
||||
var title []byte
|
||||
for i := 0; i < segments.Len(); i++ {
|
||||
s := segments.At(i)
|
||||
title = append(title, block.Value(s)...)
|
||||
}
|
||||
pos := util.FindClosure(line[offset:], opener, closer, false, true)
|
||||
if pos < 0 {
|
||||
title = append(title, line[offset:]...)
|
||||
block.AdvanceLine()
|
||||
continue
|
||||
}
|
||||
pos += offset + 1 // 1: closer
|
||||
block.Advance(pos)
|
||||
if i == 0 { // avoid allocating new slice
|
||||
return line[offset : pos-1], true
|
||||
}
|
||||
return append(title, line[offset:pos-1]...), true
|
||||
return title, true
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
||||
func (s *linkParser) CloseBlock(parent ast.Node, block text.Reader, pc Context) {
|
||||
|
||||
77
vendor/github.com/yuin/goldmark/parser/link_ref.go
сгенерированный
поставляемый
77
vendor/github.com/yuin/goldmark/parser/link_ref.go
сгенерированный
поставляемый
@@ -52,7 +52,7 @@ func (p *linkReferenceParagraphTransformer) Transform(node *ast.Paragraph, reade
|
||||
|
||||
func parseLinkReferenceDefinition(block text.Reader, pc Context) (int, int) {
|
||||
block.SkipSpaces()
|
||||
line, segment := block.PeekLine()
|
||||
line, _ := block.PeekLine()
|
||||
if line == nil {
|
||||
return -1, -1
|
||||
}
|
||||
@@ -67,39 +67,34 @@ func parseLinkReferenceDefinition(block text.Reader, pc Context) (int, int) {
|
||||
if line[pos] != '[' {
|
||||
return -1, -1
|
||||
}
|
||||
open := segment.Start + pos + 1
|
||||
closes := -1
|
||||
block.Advance(pos + 1)
|
||||
for {
|
||||
line, segment = block.PeekLine()
|
||||
if line == nil {
|
||||
return -1, -1
|
||||
}
|
||||
closure := util.FindClosure(line, '[', ']', false, false)
|
||||
if closure > -1 {
|
||||
closes = segment.Start + closure
|
||||
next := closure + 1
|
||||
if next >= len(line) || line[next] != ':' {
|
||||
return -1, -1
|
||||
}
|
||||
block.Advance(next + 1)
|
||||
break
|
||||
}
|
||||
block.AdvanceLine()
|
||||
}
|
||||
if closes < 0 {
|
||||
segments, found := block.FindClosure('[', ']', linkFindClosureOptions)
|
||||
if !found {
|
||||
return -1, -1
|
||||
}
|
||||
label := block.Value(text.NewSegment(open, closes))
|
||||
var label []byte
|
||||
if segments.Len() == 1 {
|
||||
label = block.Value(segments.At(0))
|
||||
} else {
|
||||
for i := 0; i < segments.Len(); i++ {
|
||||
s := segments.At(i)
|
||||
label = append(label, block.Value(s)...)
|
||||
}
|
||||
}
|
||||
if util.IsBlank(label) {
|
||||
return -1, -1
|
||||
}
|
||||
block.SkipSpaces()
|
||||
if block.Peek() != ':' {
|
||||
return -1, -1
|
||||
}
|
||||
block.Advance(1)
|
||||
block.SkipSpaces()
|
||||
destination, ok := parseLinkDestination(block)
|
||||
if !ok {
|
||||
return -1, -1
|
||||
}
|
||||
line, segment = block.PeekLine()
|
||||
line, _ = block.PeekLine()
|
||||
isNewLine := line == nil || util.IsBlank(line)
|
||||
|
||||
endLine, _ := block.Position()
|
||||
@@ -117,45 +112,39 @@ func parseLinkReferenceDefinition(block text.Reader, pc Context) (int, int) {
|
||||
return -1, -1
|
||||
}
|
||||
block.Advance(1)
|
||||
open = -1
|
||||
closes = -1
|
||||
closer := opener
|
||||
if opener == '(' {
|
||||
closer = ')'
|
||||
}
|
||||
for {
|
||||
line, segment = block.PeekLine()
|
||||
if line == nil {
|
||||
segments, found = block.FindClosure(opener, closer, linkFindClosureOptions)
|
||||
if !found {
|
||||
if !isNewLine {
|
||||
return -1, -1
|
||||
}
|
||||
if open < 0 {
|
||||
open = segment.Start
|
||||
}
|
||||
closure := util.FindClosure(line, opener, closer, false, true)
|
||||
if closure > -1 {
|
||||
closes = segment.Start + closure
|
||||
block.Advance(closure + 1)
|
||||
break
|
||||
}
|
||||
block.AdvanceLine()
|
||||
ref := NewReference(label, destination, nil)
|
||||
pc.AddReference(ref)
|
||||
return startLine, endLine
|
||||
}
|
||||
if closes < 0 {
|
||||
return -1, -1
|
||||
var title []byte
|
||||
if segments.Len() == 1 {
|
||||
title = block.Value(segments.At(0))
|
||||
} else {
|
||||
for i := 0; i < segments.Len(); i++ {
|
||||
s := segments.At(i)
|
||||
title = append(title, block.Value(s)...)
|
||||
}
|
||||
}
|
||||
|
||||
line, segment = block.PeekLine()
|
||||
line, _ = block.PeekLine()
|
||||
if line != nil && !util.IsBlank(line) {
|
||||
if !isNewLine {
|
||||
return -1, -1
|
||||
}
|
||||
title := block.Value(text.NewSegment(open, closes))
|
||||
ref := NewReference(label, destination, title)
|
||||
pc.AddReference(ref)
|
||||
return startLine, endLine
|
||||
}
|
||||
|
||||
title := block.Value(text.NewSegment(open, closes))
|
||||
|
||||
endLine, _ = block.Position()
|
||||
ref := NewReference(label, destination, title)
|
||||
pc.AddReference(ref)
|
||||
|
||||
7
vendor/github.com/yuin/goldmark/parser/list.go
сгенерированный
поставляемый
7
vendor/github.com/yuin/goldmark/parser/list.go
сгенерированный
поставляемый
@@ -1,10 +1,11 @@
|
||||
package parser
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/yuin/goldmark/ast"
|
||||
"github.com/yuin/goldmark/text"
|
||||
"github.com/yuin/goldmark/util"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type listItemType int
|
||||
@@ -143,7 +144,7 @@ func (b *listParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast.
|
||||
return nil, NoChildren
|
||||
}
|
||||
//an empty list item cannot interrupt a paragraph:
|
||||
if match[5]-match[4] == 1 {
|
||||
if match[5]-match[4] <= 1 {
|
||||
return nil, NoChildren
|
||||
}
|
||||
}
|
||||
@@ -165,7 +166,7 @@ func (b *listParser) Continue(node ast.Node, reader text.Reader, pc Context) Sta
|
||||
return Close
|
||||
}
|
||||
|
||||
reader.Advance(len(line)-1)
|
||||
reader.Advance(len(line) - 1)
|
||||
return Continue | HasChildren
|
||||
}
|
||||
|
||||
|
||||
2
vendor/github.com/yuin/goldmark/parser/list_item.go
сгенерированный
поставляемый
2
vendor/github.com/yuin/goldmark/parser/list_item.go
сгенерированный
поставляемый
@@ -53,7 +53,7 @@ func (b *listItemParser) Open(parent ast.Node, reader text.Reader, pc Context) (
|
||||
func (b *listItemParser) Continue(node ast.Node, reader text.Reader, pc Context) State {
|
||||
line, _ := reader.PeekLine()
|
||||
if util.IsBlank(line) {
|
||||
reader.Advance(len(line)-1)
|
||||
reader.Advance(len(line) - 1)
|
||||
|
||||
return Continue | HasChildren
|
||||
}
|
||||
|
||||
2
vendor/github.com/yuin/goldmark/parser/parser.go
сгенерированный
поставляемый
2
vendor/github.com/yuin/goldmark/parser/parser.go
сгенерированный
поставляемый
@@ -1148,7 +1148,7 @@ func (p *parser) parseBlock(block text.BlockReader, parent ast.Node, pc Context)
|
||||
} else if hasNewLine {
|
||||
// If the line ends with a newline character, but it is not a hardlineBreak, then it is a softLinebreak
|
||||
// If the line ends with a hardlineBreak, then it cannot end with a softLinebreak
|
||||
// See https://spec.commonmark.org/0.29/#soft-line-breaks
|
||||
// See https://spec.commonmark.org/0.30/#soft-line-breaks
|
||||
softLinebreak = true
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user