summaryrefslogtreecommitdiffstats
path: root/modules/markup/html_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/markup/html_test.go')
-rw-r--r--modules/markup/html_test.go81
1 files changed, 81 insertions, 0 deletions
diff --git a/modules/markup/html_test.go b/modules/markup/html_test.go
index 1b8a92e51f..a1a99c1a7f 100644
--- a/modules/markup/html_test.go
+++ b/modules/markup/html_test.go
@@ -917,5 +917,86 @@ func TestRender_FilePreview(t *testing.T) {
`<p></p>`,
localMetas,
)
+
+ testRender(
+ "first "+commitFilePreview+" second "+commitFilePreview+" third "+commitFilePreview,
+ `<p>first </p>`+
+ `<div class="file-preview-box">`+
+ `<div class="header">`+
+ `<div>`+
+ `<a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20/path/to/file.go#L2-L3" class="muted" rel="nofollow">path/to/file.go</a>`+
+ `</div>`+
+ `<span class="text small grey">`+
+ `Lines 2 to 3 in <a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20" class="text black" rel="nofollow">190d949</a>`+
+ `</span>`+
+ `</div>`+
+ `<div class="ui table">`+
+ `<table class="file-preview">`+
+ `<tbody>`+
+ `<tr>`+
+ `<td class="lines-num"><span data-line-number="2"></span></td>`+
+ `<td class="lines-code chroma"><code class="code-inner"><span class="nx">B</span>`+"\n"+`</code></td>`+
+ `</tr>`+
+ `<tr>`+
+ `<td class="lines-num"><span data-line-number="3"></span></td>`+
+ `<td class="lines-code chroma"><code class="code-inner"><span class="nx">C</span>`+"\n"+`</code></td>`+
+ `</tr>`+
+ `</tbody>`+
+ `</table>`+
+ `</div>`+
+ `</div>`+
+ `<p> second </p>`+
+ `<div class="file-preview-box">`+
+ `<div class="header">`+
+ `<div>`+
+ `<a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20/path/to/file.go#L2-L3" class="muted" rel="nofollow">path/to/file.go</a>`+
+ `</div>`+
+ `<span class="text small grey">`+
+ `Lines 2 to 3 in <a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20" class="text black" rel="nofollow">190d949</a>`+
+ `</span>`+
+ `</div>`+
+ `<div class="ui table">`+
+ `<table class="file-preview">`+
+ `<tbody>`+
+ `<tr>`+
+ `<td class="lines-num"><span data-line-number="2"></span></td>`+
+ `<td class="lines-code chroma"><code class="code-inner"><span class="nx">B</span>`+"\n"+`</code></td>`+
+ `</tr>`+
+ `<tr>`+
+ `<td class="lines-num"><span data-line-number="3"></span></td>`+
+ `<td class="lines-code chroma"><code class="code-inner"><span class="nx">C</span>`+"\n"+`</code></td>`+
+ `</tr>`+
+ `</tbody>`+
+ `</table>`+
+ `</div>`+
+ `</div>`+
+ `<p> third </p>`+
+ `<div class="file-preview-box">`+
+ `<div class="header">`+
+ `<div>`+
+ `<a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20/path/to/file.go#L2-L3" class="muted" rel="nofollow">path/to/file.go</a>`+
+ `</div>`+
+ `<span class="text small grey">`+
+ `Lines 2 to 3 in <a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20" class="text black" rel="nofollow">190d949</a>`+
+ `</span>`+
+ `</div>`+
+ `<div class="ui table">`+
+ `<table class="file-preview">`+
+ `<tbody>`+
+ `<tr>`+
+ `<td class="lines-num"><span data-line-number="2"></span></td>`+
+ `<td class="lines-code chroma"><code class="code-inner"><span class="nx">B</span>`+"\n"+`</code></td>`+
+ `</tr>`+
+ `<tr>`+
+ `<td class="lines-num"><span data-line-number="3"></span></td>`+
+ `<td class="lines-code chroma"><code class="code-inner"><span class="nx">C</span>`+"\n"+`</code></td>`+
+ `</tr>`+
+ `</tbody>`+
+ `</table>`+
+ `</div>`+
+ `</div>`+
+ `<p></p>`,
+ localMetas,
+ )
})
}