mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-11-03 18:32:25 -06:00 
			
		
		
		
	[chore]: Bump github.com/yuin/goldmark from 1.7.4 to 1.7.6 (#3430)
Bumps [github.com/yuin/goldmark](https://github.com/yuin/goldmark) from 1.7.4 to 1.7.6. - [Release notes](https://github.com/yuin/goldmark/releases) - [Commits](https://github.com/yuin/goldmark/compare/v1.7.4...v1.7.6) --- updated-dependencies: - dependency-name: github.com/yuin/goldmark dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
		
					parent
					
						
							
								020da28daa
							
						
					
				
			
			
				commit
				
					
						be3b8076ca
					
				
			
		
					 13 changed files with 2209 additions and 2144 deletions
				
			
		
							
								
								
									
										10
									
								
								vendor/github.com/yuin/goldmark/ast/block.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								vendor/github.com/yuin/goldmark/ast/block.go
									
										
									
										generated
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
package ast
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -47,6 +48,15 @@ func (b *BaseBlock) SetLines(v *textm.Segments) {
 | 
			
		|||
	b.lines = v
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Text implements Node.Text.
 | 
			
		||||
func (b *BaseBlock) Text(source []byte) []byte {
 | 
			
		||||
	var buf bytes.Buffer
 | 
			
		||||
	for _, line := range b.Lines().Sliced(0, b.Lines().Len()) {
 | 
			
		||||
		buf.Write(line.Value(source))
 | 
			
		||||
	}
 | 
			
		||||
	return buf.Bytes()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A Document struct is a root node of Markdown text.
 | 
			
		||||
type Document struct {
 | 
			
		||||
	BaseBlock
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4
									
								
								vendor/github.com/yuin/goldmark/extension/table.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/yuin/goldmark/extension/table.go
									
										
									
										generated
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -184,11 +184,11 @@ func (b *tableParagraphTransformer) Transform(node *gast.Paragraph, reader text.
 | 
			
		|||
func (b *tableParagraphTransformer) parseRow(segment text.Segment,
 | 
			
		||||
	alignments []ast.Alignment, isHeader bool, reader text.Reader, pc parser.Context) *ast.TableRow {
 | 
			
		||||
	source := reader.Source()
 | 
			
		||||
	segment = segment.TrimLeftSpace(source)
 | 
			
		||||
	segment = segment.TrimRightSpace(source)
 | 
			
		||||
	line := segment.Value(source)
 | 
			
		||||
	pos := 0
 | 
			
		||||
	pos += util.TrimLeftSpaceLength(line)
 | 
			
		||||
	limit := len(line)
 | 
			
		||||
	limit -= util.TrimRightSpaceLength(line)
 | 
			
		||||
	row := ast.NewTableRow(alignments)
 | 
			
		||||
	if len(line) > 0 && line[pos] == '|' {
 | 
			
		||||
		pos++
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										11
									
								
								vendor/github.com/yuin/goldmark/parser/blockquote.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								vendor/github.com/yuin/goldmark/parser/blockquote.go
									
										
									
										generated
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -28,12 +28,13 @@ func (b *blockquoteParser) process(reader text.Reader) bool {
 | 
			
		|||
		reader.Advance(pos)
 | 
			
		||||
		return true
 | 
			
		||||
	}
 | 
			
		||||
	if line[pos] == ' ' || line[pos] == '\t' {
 | 
			
		||||
		pos++
 | 
			
		||||
	}
 | 
			
		||||
	reader.Advance(pos)
 | 
			
		||||
	if line[pos-1] == '\t' {
 | 
			
		||||
		reader.SetPadding(2)
 | 
			
		||||
	if line[pos] == ' ' || line[pos] == '\t' {
 | 
			
		||||
		padding := 0
 | 
			
		||||
		if line[pos] == '\t' {
 | 
			
		||||
			padding = util.TabWidth(reader.LineOffset()) - 1
 | 
			
		||||
		}
 | 
			
		||||
		reader.AdvanceAndSetPadding(1, padding)
 | 
			
		||||
	}
 | 
			
		||||
	return true
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								vendor/github.com/yuin/goldmark/parser/list_item.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/yuin/goldmark/parser/list_item.go
									
										
									
										generated
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -58,7 +58,7 @@ func (b *listItemParser) Continue(node ast.Node, reader text.Reader, pc Context)
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	offset := lastOffset(node.Parent())
 | 
			
		||||
	isEmpty := node.ChildCount() == 0
 | 
			
		||||
	isEmpty := node.ChildCount() == 0 && pc.Get(emptyListItemWithBlankLines) != nil
 | 
			
		||||
	indent, _ := util.IndentWidth(line, reader.LineOffset())
 | 
			
		||||
	if (isEmpty || indent < offset) && indent < 4 {
 | 
			
		||||
		_, typ := matchesListItem(line, true)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										8
									
								
								vendor/github.com/yuin/goldmark/parser/parser.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								vendor/github.com/yuin/goldmark/parser/parser.go
									
										
									
										generated
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -878,10 +878,17 @@ func (p *parser) Parse(reader text.Reader, opts ...ParseOption) ast.Node {
 | 
			
		|||
	blockReader := text.NewBlockReader(reader.Source(), nil)
 | 
			
		||||
	p.walkBlock(root, func(node ast.Node) {
 | 
			
		||||
		p.parseBlock(blockReader, node, pc)
 | 
			
		||||
		lines := node.Lines()
 | 
			
		||||
		if lines != nil && lines.Len() != 0 {
 | 
			
		||||
			s := lines.At(lines.Len() - 1)
 | 
			
		||||
			s.EOB = true
 | 
			
		||||
			lines.Set(lines.Len()-1, s)
 | 
			
		||||
		}
 | 
			
		||||
	})
 | 
			
		||||
	for _, at := range p.astTransformers {
 | 
			
		||||
		at.Transform(root, reader, pc)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// root.Dump(reader.Source(), 0)
 | 
			
		||||
	return root
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1256,4 +1263,5 @@ func (p *parser) parseBlock(block text.BlockReader, parent ast.Node, pc Context)
 | 
			
		|||
	for _, ip := range p.closeBlockers {
 | 
			
		||||
		ip.CloseBlock(parent, block, pc)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										18
									
								
								vendor/github.com/yuin/goldmark/text/segment.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								vendor/github.com/yuin/goldmark/text/segment.go
									
										
									
										generated
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -2,6 +2,7 @@ package text
 | 
			
		|||
 | 
			
		||||
import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
 | 
			
		||||
	"github.com/yuin/goldmark/util"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -18,6 +19,9 @@ type Segment struct {
 | 
			
		|||
 | 
			
		||||
	// Padding is a padding length of the segment.
 | 
			
		||||
	Padding int
 | 
			
		||||
 | 
			
		||||
	// EOB is true if the segment is end of the block.
 | 
			
		||||
	EOB bool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewSegment return a new Segment.
 | 
			
		||||
| 
						 | 
				
			
			@ -40,12 +44,18 @@ func NewSegmentPadding(start, stop, n int) Segment {
 | 
			
		|||
 | 
			
		||||
// Value returns a value of the segment.
 | 
			
		||||
func (t *Segment) Value(buffer []byte) []byte {
 | 
			
		||||
	var result []byte
 | 
			
		||||
	if t.Padding == 0 {
 | 
			
		||||
		return buffer[t.Start:t.Stop]
 | 
			
		||||
		result = buffer[t.Start:t.Stop]
 | 
			
		||||
	} else {
 | 
			
		||||
		result = make([]byte, 0, t.Padding+t.Stop-t.Start+1)
 | 
			
		||||
		result = append(result, bytes.Repeat(space, t.Padding)...)
 | 
			
		||||
		result = append(result, buffer[t.Start:t.Stop]...)
 | 
			
		||||
	}
 | 
			
		||||
	result := make([]byte, 0, t.Padding+t.Stop-t.Start+1)
 | 
			
		||||
	result = append(result, bytes.Repeat(space, t.Padding)...)
 | 
			
		||||
	return append(result, buffer[t.Start:t.Stop]...)
 | 
			
		||||
	if t.EOB && len(result) > 0 && result[len(result)-1] != '\n' {
 | 
			
		||||
		result = append(result, '\n')
 | 
			
		||||
	}
 | 
			
		||||
	return result
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Len returns a length of the segment.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4264
									
								
								vendor/github.com/yuin/goldmark/util/html5entities.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4264
									
								
								vendor/github.com/yuin/goldmark/util/html5entities.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
							
								
								
									
										6
									
								
								vendor/github.com/yuin/goldmark/util/util.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								vendor/github.com/yuin/goldmark/util/util.go
									
										
									
										generated
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -166,7 +166,13 @@ func IndentPositionPadding(bs []byte, currentPos, paddingv, width int) (pos, pad
 | 
			
		|||
	w := 0
 | 
			
		||||
	i := 0
 | 
			
		||||
	l := len(bs)
 | 
			
		||||
	p := paddingv
 | 
			
		||||
	for ; i < l; i++ {
 | 
			
		||||
		if p > 0 {
 | 
			
		||||
			p--
 | 
			
		||||
			w++
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
		if bs[i] == '\t' && w < width {
 | 
			
		||||
			w += TabWidth(currentPos + w)
 | 
			
		||||
		} else if bs[i] == ' ' && w < width {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
//go:build !appengine && !js
 | 
			
		||||
// +build !appengine,!js
 | 
			
		||||
//go:build !appengine && !js && !go1.21
 | 
			
		||||
// +build !appengine,!js,!go1.21
 | 
			
		||||
 | 
			
		||||
package util
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										18
									
								
								vendor/github.com/yuin/goldmark/util/util_unsafe_go121.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								vendor/github.com/yuin/goldmark/util/util_unsafe_go121.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,18 @@
 | 
			
		|||
//go:build !appengine && !js && go1.21
 | 
			
		||||
// +build !appengine,!js,go1.21
 | 
			
		||||
 | 
			
		||||
package util
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"unsafe"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// BytesToReadOnlyString returns a string converted from given bytes.
 | 
			
		||||
func BytesToReadOnlyString(b []byte) string {
 | 
			
		||||
	return unsafe.String(unsafe.SliceData(b), len(b))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// StringToReadOnlyBytes returns bytes converted from given string.
 | 
			
		||||
func StringToReadOnlyBytes(s string) []byte {
 | 
			
		||||
	return unsafe.Slice(unsafe.StringData(s), len(s))
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue