mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Make cross-reference issue links work in markdown documents again (#28682)
In #26365 issue references were disabled entirely for documents, intending to match GitHub behavior. However cross-references do appear to work in documents on GitHub. This is useful for example to write release notes in a markdown document and reference issues. While the simpler syntax may create links when not intended, hopefully the cross-reference syntax is unique enough to avoid it.
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							91aa263225
						
					
				
				
					commit
					12c0487e01
				
			| @@ -331,8 +331,11 @@ func FindAllIssueReferences(content string) []IssueReference { | ||||
| } | ||||
|  | ||||
| // FindRenderizableReferenceNumeric returns the first unvalidated reference found in a string. | ||||
| func FindRenderizableReferenceNumeric(content string, prOnly bool) (bool, *RenderizableReference) { | ||||
| 	match := issueNumericPattern.FindStringSubmatchIndex(content) | ||||
| func FindRenderizableReferenceNumeric(content string, prOnly, crossLinkOnly bool) (bool, *RenderizableReference) { | ||||
| 	var match []int | ||||
| 	if !crossLinkOnly { | ||||
| 		match = issueNumericPattern.FindStringSubmatchIndex(content) | ||||
| 	} | ||||
| 	if match == nil { | ||||
| 		if match = crossReferenceIssueNumericPattern.FindStringSubmatchIndex(content); match == nil { | ||||
| 			return false, nil | ||||
|   | ||||
		Reference in New Issue
	
	Block a user