summaryrefslogtreecommitdiffstats
path: root/modules/markup/html_test.go
diff options
context:
space:
mode:
authormrsdizzie <info@mrsdizzie.com>2019-03-27 11:37:54 -0400
committertechknowlogick <matti@mdranta.net>2019-03-27 11:37:54 -0400
commitc8650aef0aefb06ff416912e4ae5f42eaa53ef63 (patch)
tree58c8e217f32d8f2c85b200eac9fada157e8aaab4 /modules/markup/html_test.go
parentd77176912bccf1dc0ad93366df55f00fee23b498 (diff)
downloadgitea-c8650aef0aefb06ff416912e4ae5f42eaa53ef63.tar.gz
gitea-c8650aef0aefb06ff416912e4ae5f42eaa53ef63.zip
Change order that PostProcess Processors are run (#6445)
Make sure Processors that work on full links are run first so that something matching another pattern doesn't alter a link before we get to it, for example: https://stackoverflow.com/questions/2896191/what-is-go-used-fore Fixes #4813
Diffstat (limited to 'modules/markup/html_test.go')
-rw-r--r--modules/markup/html_test.go6
1 files changed, 6 insertions, 0 deletions
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/",
`<p><a href="https://foo_bar.example.com/" rel="nofollow">https://foo_bar.example.com/</a></p>`)
+ test(
+ "https://stackoverflow.com/questions/2896191/what-is-go-used-fore",
+ `<p><a href="https://stackoverflow.com/questions/2896191/what-is-go-used-fore" rel="nofollow">https://stackoverflow.com/questions/2896191/what-is-go-used-fore</a></p>`)
+ test(
+ "https://username:password@gitea.com",
+ `<p><a href="https://username:password@gitea.com" rel="nofollow">https://username:password@gitea.com</a></p>`)
// Test that should *not* be turned into URL
test(