Skip to content

Commit a2fd110

Browse files
committed
Render button only on raw text
1 parent 4fd9eba commit a2fd110

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

templates/repo/view_file.tmpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@
4646
{{end}}
4747
{{if not .ReadmeInList}}
4848
<div class="ui buttons mr-2">
49-
<button class="ui mini basic button small compact tooltip copy-content" id="clipboard-btn" data-content="{{.locale.Tr "copy_content"}}" aria-label="{{.locale.Tr "copy_content"}}">
49+
<button class="ui mini basic button small compact tooltip copy-content" id="clipboard-btn" data-content="{{.locale.Tr "copy_content"}}" aria-label="{{.locale.Tr "copy_content"}}"
50+
{{if or (.IsMarkup) (.IsRenderedHTML) (not .IsTextSource)}}
51+
disabled
52+
{{end}}
53+
>
5054
{{svg "octicon-copy" 14}}
5155
</button>
5256
<a class="ui mini basic button" href="{{$.RawFileLink}}">{{.locale.Tr "repo.file_raw"}}</a>

0 commit comments

Comments
 (0)