diff --git a/modules/markup/html.go b/modules/markup/html.go index 20a158b1c5..4a2f36046a 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -152,15 +152,15 @@ func (p *postProcessError) Error() string { type processor func(ctx *postProcessCtx, node *html.Node) var defaultProcessors = []processor{ - mentionProcessor, - shortLinkProcessor, fullIssuePatternProcessor, + fullSha1PatternProcessor, + shortLinkProcessor, + linkProcessor, + mentionProcessor, issueIndexPatternProcessor, crossReferenceIssueIndexPatternProcessor, - fullSha1PatternProcessor, sha1CurrentPatternProcessor, emailAddressProcessor, - linkProcessor, } type postProcessCtx struct { @@ -194,14 +194,14 @@ func PostProcess( } var commitMessageProcessors = []processor{ - mentionProcessor, fullIssuePatternProcessor, + fullSha1PatternProcessor, + linkProcessor, + mentionProcessor, issueIndexPatternProcessor, crossReferenceIssueIndexPatternProcessor, - fullSha1PatternProcessor, sha1CurrentPatternProcessor, emailAddressProcessor, - linkProcessor, } // RenderCommitMessage will use the same logic as PostProcess, but will disable diff --git a/modules/markup/html_test.go b/modules/markup/html_test.go index ff68201995..8d113b18a1 100644 --- a/modules/markup/html_test.go +++ b/modules/markup/html_test.go @@ -113,6 +113,12 @@ func TestRender_links(t *testing.T) { test( "https://foo_bar.example.com/", `
`) + test( + "https://stackoverflow.com/questions/2896191/what-is-go-used-fore", + `https://stackoverflow.com/questions/2896191/what-is-go-used-fore
`) + test( + "https://username:password@gitea.com", + ``) // Test that should *not* be turned into URL test(