Skip to content

Commit c024667

Browse files
authored
Fix markup background, improve wiki rendering (#23750)
Fix regression from #23578. Only visible on arc-green. Before: <img width="997" alt="Screenshot 2023-03-27 at 19 14 21" src="https://user-images.githubusercontent.com/115237/228016589-e7cabfb9-bfd0-45fd-9407-6b76c665ed1a.png"> After: <img width="1000" alt="Screenshot 2023-03-27 at 19 14 05" src="https://user-images.githubusercontent.com/115237/228016600-db2e6002-4e2c-4d18-8393-9d7e1f525acb.png"> Fixes: #20625 Fixes: #23718
1 parent 3876f56 commit c024667

File tree

4 files changed

+29
-27
lines changed

4 files changed

+29
-27
lines changed

templates/repo/wiki/pages.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<a href="{{$.RepoLink}}/wiki/{{.SubURL}}">{{.Name}}</a>
2222
</td>
2323
{{$timeSince := TimeSinceUnix .UpdatedUnix $.locale}}
24-
<td class="text right grey">{{$.locale.Tr "repo.wiki.last_updated" $timeSince | Safe}}</td>
24+
<td class="text right">{{$.locale.Tr "repo.wiki.last_updated" $timeSince | Safe}}</td>
2525
</tr>
2626
{{end}}
2727
</tbody>

templates/repo/wiki/view.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
<p>{{.FormatWarning}}</p>
6666
</div>
6767
{{end}}
68-
<div class="ui {{if or .sidebarPresent .toc}}grid equal width{{end}}" style="margin-top: 1rem;">
69-
<div class="ui {{if or .sidebarPresent .toc}}eleven wide column{{end}} segment markup wiki-content-main">
68+
<div class="ui gt-mt-0 {{if or .sidebarPresent .toc}}grid equal width{{end}}">
69+
<div class="ui {{if or .sidebarPresent .toc}}eleven wide column{{else}}gt-ml-0{{end}} segment markup wiki-content-main">
7070
{{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}}
7171
{{.content | Safe}}
7272
</div>

web_src/css/markup/content.css

+8-9
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@
33
font-size: 16px;
44
line-height: 1.5 !important;
55
word-wrap: break-word;
6-
background: var(--color-box-body);
7-
}
8-
9-
.markup.ui.segment {
10-
padding: 3em;
11-
}
12-
13-
.markup.file-view {
14-
padding: 2em !important;
156
}
167

178
.markup > *:first-child {
@@ -309,6 +300,14 @@
309300
.markup img {
310301
max-width: 100%;
311302
box-sizing: initial;
303+
}
304+
305+
/* this background ensures images can break <hr>. We can only do this on
306+
cases where the background is known and not transparent. */
307+
.markup.file-view img,
308+
.comment-body .markup img, /* regular comment */
309+
.comment-content .markup img, /* code comment */
310+
.wiki .markup img {
312311
background: var(--color-box-body);
313312
}
314313

web_src/css/repository.css

+18-15
Original file line numberDiff line numberDiff line change
@@ -965,10 +965,6 @@
965965
max-width: 100%;
966966
}
967967

968-
.repository.view.issue .comment-list .ui.comments .avatar {
969-
margin-right: 0.5rem;
970-
}
971-
972968
.repository.view.issue .comment-list .comment > .content > div:first-child {
973969
border-top-left-radius: 4px;
974970
border-top-right-radius: 4px;
@@ -1093,6 +1089,14 @@
10931089
margin-left: 36px;
10941090
}
10951091

1092+
.repository.view.issue .comment-list .comment > .avatar {
1093+
margin-top: 6px;
1094+
}
1095+
1096+
.repository.view.issue .comment-list .comment > .avatar ~ .content {
1097+
margin-left: 3em;
1098+
}
1099+
10961100
.repository.view.issue .comment-list .code-comment img.avatar,
10971101
.repository.view.issue .comment-list .comment img.avatar {
10981102
width: 28px;
@@ -2092,17 +2096,17 @@
20922096
height: 48px;
20932097
}
20942098

2095-
.repository.wiki.view > .markup {
2096-
padding: 15px 30px;
2099+
.repository.wiki.new .ui.attached.tabular.menu.previewtabs {
2100+
margin-bottom: 15px;
20972101
}
20982102

2099-
.repository.wiki.view > .markup h1:first-of-type,
2100-
.repository.wiki.view > .markup h2:first-of-type,
2101-
.repository.wiki.view > .markup h3:first-of-type,
2102-
.repository.wiki.view > .markup h4:first-of-type,
2103-
.repository.wiki.view > .markup h5:first-of-type,
2104-
.repository.wiki.view > .markup h6:first-of-type {
2105-
margin-top: 0;
2103+
.file-view.markup {
2104+
padding: 1em 2em;
2105+
}
2106+
2107+
.wiki-content-main {
2108+
padding: 1em 2em !important;
2109+
margin-left: 1em !important;
21062110
}
21072111

21082112

@@ -2730,11 +2734,10 @@
27302734
width: 100% !important;
27312735
max-width: 100% !important;
27322736
margin: 0 !important;
2733-
padding: 0 !important;
2737+
padding: 1em;
27342738
}
27352739

27362740
.comment-body .markup {
2737-
padding: 1em;
27382741
border-radius: 0 0 var(--border-radius) var(--border-radius); /* don't render outside box */
27392742
}
27402743

0 commit comments

Comments
 (0)