diff options
author | silverwind <me@silverwind.io> | 2019-04-09 05:18:48 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-04-09 06:18:48 +0300 |
commit | 8e949db3b540486a8b5f085ebf2a7ff2d8cea646 (patch) | |
tree | 3e0bb5be3089d97963a865d8f4aab5d9cb661967 /modules/markup/html_test.go | |
parent | 61b85990a62419aed0d425643cf723866e6de760 (diff) | |
download | gitea-8e949db3b540486a8b5f085ebf2a7ff2d8cea646.tar.gz gitea-8e949db3b540486a8b5f085ebf2a7ff2d8cea646.zip |
Render SHA1 links as code blocks (#6546)
Diffstat (limited to 'modules/markup/html_test.go')
-rw-r--r-- | modules/markup/html_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/markup/html_test.go b/modules/markup/html_test.go index 6bd9a465b5..6d3da31934 100644 --- a/modules/markup/html_test.go +++ b/modules/markup/html_test.go @@ -30,12 +30,12 @@ func TestRender_Commits(t *testing.T) { var subtree = util.URLJoin(commit, "src") var tree = strings.Replace(subtree, "/commit/", "/tree/", -1) - test(sha, `<p><a href="`+commit+`" rel="nofollow">b6dd6210ea</a></p>`) - test(sha[:7], `<p><a href="`+commit[:len(commit)-(40-7)]+`" rel="nofollow">b6dd621</a></p>`) - test(sha[:39], `<p><a href="`+commit[:len(commit)-(40-39)]+`" rel="nofollow">b6dd6210ea</a></p>`) - test(commit, `<p><a href="`+commit+`" rel="nofollow">b6dd6210ea</a></p>`) - test(tree, `<p><a href="`+tree+`" rel="nofollow">b6dd6210ea/src</a></p>`) - test("commit "+sha, `<p>commit <a href="`+commit+`" rel="nofollow">b6dd6210ea</a></p>`) + test(sha, `<p><a href="`+commit+`" rel="nofollow"><code>b6dd6210ea</code></a></p>`) + test(sha[:7], `<p><a href="`+commit[:len(commit)-(40-7)]+`" rel="nofollow"><code>b6dd621</code></a></p>`) + test(sha[:39], `<p><a href="`+commit[:len(commit)-(40-39)]+`" rel="nofollow"><code>b6dd6210ea</code></a></p>`) + test(commit, `<p><a href="`+commit+`" rel="nofollow"><code>b6dd6210ea</code></a></p>`) + test(tree, `<p><a href="`+tree+`" rel="nofollow"><code>b6dd6210ea/src</code></a></p>`) + test("commit "+sha, `<p>commit <a href="`+commit+`" rel="nofollow"><code>b6dd6210ea</code></a></p>`) test("/home/gitea/"+sha, "<p>/home/gitea/"+sha+"</p>") } |