Skip to content

Fix markup background, improve wiki rendering #23750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/repo/wiki/pages.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<a href="{{$.RepoLink}}/wiki/{{.SubURL}}">{{.Name}}</a>
</td>
{{$timeSince := TimeSinceUnix .UpdatedUnix $.locale}}
<td class="text right grey">{{$.locale.Tr "repo.wiki.last_updated" $timeSince | Safe}}</td>
<td class="text right">{{$.locale.Tr "repo.wiki.last_updated" $timeSince | Safe}}</td>
</tr>
{{end}}
</tbody>
Expand Down
4 changes: 2 additions & 2 deletions templates/repo/wiki/view.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
<p>{{.FormatWarning}}</p>
</div>
{{end}}
<div class="ui {{if or .sidebarPresent .toc}}grid equal width{{end}}" style="margin-top: 1rem;">
<div class="ui {{if or .sidebarPresent .toc}}eleven wide column{{end}} segment markup wiki-content-main">
<div class="ui gt-mt-0 {{if or .sidebarPresent .toc}}grid equal width{{end}}">
<div class="ui {{if or .sidebarPresent .toc}}eleven wide column{{else}}gt-ml-0{{end}} segment markup wiki-content-main">
{{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}}
{{.content | Safe}}
</div>
Expand Down
17 changes: 8 additions & 9 deletions web_src/css/markup/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@
font-size: 16px;
line-height: 1.5 !important;
word-wrap: break-word;
background: var(--color-box-body);
}

.markup.ui.segment {
padding: 3em;
}

.markup.file-view {
padding: 2em !important;
}

.markup > *:first-child {
Expand Down Expand Up @@ -309,6 +300,14 @@
.markup img {
max-width: 100%;
box-sizing: initial;
}

/* this background ensures images can break <hr>. We can only do this on
cases where the background is known and not transparent. */
.markup.file-view img,
.comment-body .markup img, /* regular comment */
.comment-content .markup img, /* code comment */
.wiki .markup img {
background: var(--color-box-body);
}

Expand Down
33 changes: 18 additions & 15 deletions web_src/css/repository.css
Original file line number Diff line number Diff line change
Expand Up @@ -965,10 +965,6 @@
max-width: 100%;
}

.repository.view.issue .comment-list .ui.comments .avatar {
margin-right: 0.5rem;
}

.repository.view.issue .comment-list .comment > .content > div:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
Expand Down Expand Up @@ -1093,6 +1089,14 @@
margin-left: 36px;
}

.repository.view.issue .comment-list .comment > .avatar {
margin-top: 6px;
}

.repository.view.issue .comment-list .comment > .avatar ~ .content {
margin-left: 3em;
}

.repository.view.issue .comment-list .code-comment img.avatar,
.repository.view.issue .comment-list .comment img.avatar {
width: 28px;
Expand Down Expand Up @@ -2092,17 +2096,17 @@
height: 48px;
}

.repository.wiki.view > .markup {
padding: 15px 30px;
.repository.wiki.new .ui.attached.tabular.menu.previewtabs {
margin-bottom: 15px;
}

.repository.wiki.view > .markup h1:first-of-type,
.repository.wiki.view > .markup h2:first-of-type,
.repository.wiki.view > .markup h3:first-of-type,
.repository.wiki.view > .markup h4:first-of-type,
.repository.wiki.view > .markup h5:first-of-type,
.repository.wiki.view > .markup h6:first-of-type {
margin-top: 0;
.file-view.markup {
padding: 1em 2em;
}

.wiki-content-main {
padding: 1em 2em !important;
margin-left: 1em !important;
}


Expand Down Expand Up @@ -2730,11 +2734,10 @@
width: 100% !important;
max-width: 100% !important;
margin: 0 !important;
padding: 0 !important;
padding: 1em;
}

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

Expand Down