mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Vendor Update (#14696)
* github.com/yuin/goldmark v1.3.1 -> v1.3.2 * github.com/xanzy/go-gitlab v0.42.0 -> v0.44.0 * github.com/prometheus/client_golang v1.8.0 -> v1.9.0 * github.com/minio/minio-go v7.0.7 -> v7.0.9 * github.com/lafriks/xormstore v1.3.2 -> v1.4.0 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		
							
								
								
									
										2
									
								
								vendor/github.com/yuin/goldmark/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/yuin/goldmark/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -280,7 +280,7 @@ markdown := goldmark.New( | ||||
|                 []byte("https:"), | ||||
|             }), | ||||
|             extension.WithLinkifyURLRegexp( | ||||
|                 xurls.Strict(), | ||||
|                 xurls.Strict, | ||||
|             ), | ||||
|         ), | ||||
|     ), | ||||
|   | ||||
							
								
								
									
										24
									
								
								vendor/github.com/yuin/goldmark/extension/linkify.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								vendor/github.com/yuin/goldmark/extension/linkify.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -11,9 +11,9 @@ import ( | ||||
| 	"github.com/yuin/goldmark/util" | ||||
| ) | ||||
|  | ||||
| var wwwURLRegxp = regexp.MustCompile(`^www\.[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]+(?:[/#?][-a-zA-Z0-9@:%_\+.~#!?&/=\(\);,'">\^{}\[\]` + "`" + `]*)?`) | ||||
| var wwwURLRegxp = regexp.MustCompile(`^www\.[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]+(?:[/#?][-a-zA-Z0-9@:%_\+.~#!?&/=\(\);,'">\^{}\[\]` + "`" + `]*)?`) | ||||
|  | ||||
| var urlRegexp = regexp.MustCompile(`^(?:http|https|ftp)://[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]+(?::\d+)?(?:[/#?][-a-zA-Z0-9@:%_+.~#$!?&/=\(\);,'">\^{}\[\]` + "`" + `]*)?`) | ||||
| var urlRegexp = regexp.MustCompile(`^(?:http|https|ftp)://[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]+(?::\d+)?(?:[/#?][-a-zA-Z0-9@:%_+.~#$!?&/=\(\);,'">\^{}\[\]` + "`" + `]*)?`) | ||||
|  | ||||
| // An LinkifyConfig struct is a data structure that holds configuration of the | ||||
| // Linkify extension. | ||||
| @@ -24,10 +24,12 @@ type LinkifyConfig struct { | ||||
| 	EmailRegexp      *regexp.Regexp | ||||
| } | ||||
|  | ||||
| const optLinkifyAllowedProtocols parser.OptionName = "LinkifyAllowedProtocols" | ||||
| const optLinkifyURLRegexp parser.OptionName = "LinkifyURLRegexp" | ||||
| const optLinkifyWWWRegexp parser.OptionName = "LinkifyWWWRegexp" | ||||
| const optLinkifyEmailRegexp parser.OptionName = "LinkifyEmailRegexp" | ||||
| const ( | ||||
| 	optLinkifyAllowedProtocols parser.OptionName = "LinkifyAllowedProtocols" | ||||
| 	optLinkifyURLRegexp        parser.OptionName = "LinkifyURLRegexp" | ||||
| 	optLinkifyWWWRegexp        parser.OptionName = "LinkifyWWWRegexp" | ||||
| 	optLinkifyEmailRegexp      parser.OptionName = "LinkifyEmailRegexp" | ||||
| ) | ||||
|  | ||||
| // SetOption implements SetOptioner. | ||||
| func (c *LinkifyConfig) SetOption(name parser.OptionName, value interface{}) { | ||||
| @@ -156,10 +158,12 @@ func (s *linkifyParser) Trigger() []byte { | ||||
| 	return []byte{' ', '*', '_', '~', '('} | ||||
| } | ||||
|  | ||||
| var protoHTTP = []byte("http:") | ||||
| var protoHTTPS = []byte("https:") | ||||
| var protoFTP = []byte("ftp:") | ||||
| var domainWWW = []byte("www.") | ||||
| var ( | ||||
| 	protoHTTP  = []byte("http:") | ||||
| 	protoHTTPS = []byte("https:") | ||||
| 	protoFTP   = []byte("ftp:") | ||||
| 	domainWWW  = []byte("www.") | ||||
| ) | ||||
|  | ||||
| func (s *linkifyParser) Parse(parent ast.Node, block text.Reader, pc parser.Context) ast.Node { | ||||
| 	if pc.IsInLinkLabel() { | ||||
|   | ||||
							
								
								
									
										17
									
								
								vendor/github.com/yuin/goldmark/parser/code_block.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										17
									
								
								vendor/github.com/yuin/goldmark/parser/code_block.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -49,6 +49,12 @@ func (b *codeBlockParser) Continue(node ast.Node, reader text.Reader, pc Context | ||||
| 	} | ||||
| 	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) | ||||
| 	} | ||||
|  | ||||
| 	node.Lines().Append(segment) | ||||
| 	reader.Advance(segment.Len() - 1) | ||||
| 	return Continue | NoChildren | ||||
| @@ -77,3 +83,14 @@ func (b *codeBlockParser) CanInterruptParagraph() bool { | ||||
| func (b *codeBlockParser) CanAcceptIndentedLine() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| func preserveLeadingTabInCodeBlock(segment *text.Segment, reader text.Reader) { | ||||
| 	offsetWithPadding := reader.LineOffset() | ||||
| 	sl, ss := reader.Position() | ||||
| 	reader.SetPosition(sl, text.NewSegment(ss.Start-1, ss.Stop)) | ||||
| 	if offsetWithPadding == reader.LineOffset() { | ||||
| 		segment.Padding = 0 | ||||
| 		segment.Start-- | ||||
| 	} | ||||
| 	reader.SetPosition(sl, ss) | ||||
| } | ||||
|   | ||||
							
								
								
									
										4
									
								
								vendor/github.com/yuin/goldmark/parser/fcode_block.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/yuin/goldmark/parser/fcode_block.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -71,6 +71,10 @@ func (b *fencedCodeBlockParser) Open(parent ast.Node, reader text.Reader, pc Con | ||||
| func (b *fencedCodeBlockParser) Continue(node ast.Node, reader text.Reader, pc Context) State { | ||||
| 	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) | ||||
| 	} | ||||
| 	w, pos := util.IndentWidth(line, reader.LineOffset()) | ||||
| 	if w < 4 { | ||||
| 		i := pos | ||||
|   | ||||
		Reference in New Issue
	
	Block a user