Skip to content

Commit c5fe61c

Browse files
committed
refactor markup init
1 parent 84389a7 commit c5fe61c

File tree

23 files changed

+190
-214
lines changed

23 files changed

+190
-214
lines changed

templates/org/home.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div class="ui mobile reversed stackable grid">
77
<div class="ui {{if .ShowMemberAndTeamTab}}eleven wide{{end}} column">
88
{{if .ProfileReadmeContent}}
9-
<div id="readme_profile" class="markup" data-profile-view-as-member="{{.IsViewingOrgAsMember}}">{{.ProfileReadmeContent}}</div>
9+
<div id="readme_profile" class="render-content markup" data-profile-view-as-member="{{.IsViewingOrgAsMember}}">{{.ProfileReadmeContent}}</div>
1010
{{end}}
1111
{{template "shared/repo_search" .}}
1212
{{template "explore/repo_list" .}}

templates/projects/list.tmpl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@
7474
{{end}}
7575
</div>
7676
{{if .Description}}
77-
<div class="content">
78-
{{.RenderedContent}}
79-
</div>
77+
<div class="render-content markup">{{.RenderedContent}}</div>
8078
{{end}}
8179
</li>
8280
{{end}}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<div class="field {{if not .item.VisibleOnForm}}tw-hidden{{end}}">
2-
<div class="markup">{{ctx.RenderUtils.MarkdownToHtml .item.Attributes.value}}</div>
2+
<div class="render-content markup">{{ctx.RenderUtils.MarkdownToHtml .item.Attributes.value}}</div>
33
</div>

templates/repo/issue/milestone_issues.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
{{end}}
2323
</div>
2424
{{if .Milestone.RenderedContent}}
25-
<div class="markup content tw-mb-4">
25+
<div class="render-content markup tw-mb-4">
2626
{{.Milestone.RenderedContent}}
2727
</div>
2828
{{end}}

templates/repo/issue/milestones.tmpl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@
8181
{{end}}
8282
</div>
8383
{{if .Content}}
84-
<div class="markup content">
85-
{{.RenderedContent}}
86-
</div>
84+
<div class="render-content markup">{{.RenderedContent}}</div>
8785
{{end}}
8886
</li>
8987
{{end}}

templates/repo/release/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
| <span class="ahead"><a href="{{$.RepoLink}}/compare/{{$release.TagName | PathEscapeSegments}}...{{$release.TargetBehind | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.release.ahead.commits" $release.NumCommitsBehind}}</a> {{ctx.Locale.Tr "repo.release.ahead.target" $release.TargetBehind}}</span>
6565
{{end}}
6666
</p>
67-
<div class="markup desc">
67+
<div class="render-content markup">
6868
{{$release.RenderedNote}}
6969
</div>
7070
<div class="divider"></div>

templates/repo/settings/lfs_file.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</h4>
1414
<div class="ui bottom attached table unstackable segment">
1515
{{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}}
16-
<div class="file-view{{if .IsMarkup}} markup {{.MarkupType}}{{else if .IsPlainText}} plain-text{{else if .IsTextFile}} code-view{{end}}">
16+
<div class="file-view {{if .IsPlainText}}plain-text{{else if .IsTextFile}}code-view{{end}}">
1717
{{if .IsFileTooLarge}}
1818
{{template "shared/filetoolarge" dict "RawFileLink" .RawFileLink}}
1919
{{else if not .FileSize}}

templates/repo/wiki/view.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,18 @@
6363

6464
<div class="wiki-content-parts">
6565
{{if .sidebarTocContent}}
66-
<div class="markup wiki-content-sidebar wiki-content-toc">
66+
<div class="render-content markup wiki-content-sidebar wiki-content-toc">
6767
{{.sidebarTocContent | SafeHTML}}
6868
</div>
6969
{{end}}
7070

71-
<div class="markup wiki-content-main {{if or .sidebarTocContent .sidebarPresent}}with-sidebar{{end}}">
71+
<div class="render-content markup wiki-content-main {{if or .sidebarTocContent .sidebarPresent}}with-sidebar{{end}}">
7272
{{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}}
7373
{{.content | SafeHTML}}
7474
</div>
7575

7676
{{if .sidebarPresent}}
77-
<div class="markup wiki-content-sidebar">
77+
<div class="render-content markup wiki-content-sidebar">
7878
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
7979
<a class="tw-float-right muted" href="{{.RepoLink}}/wiki/_Sidebar?action=_edit" aria-label="{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a>
8080
{{end}}
@@ -86,7 +86,7 @@
8686
<div class="tw-clear-both"></div>
8787

8888
{{if .footerPresent}}
89-
<div class="markup wiki-content-footer">
89+
<div class="render-content markup wiki-content-footer">
9090
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
9191
<a class="tw-float-right muted" href="{{.RepoLink}}/wiki/_Footer?action=_edit" aria-label="{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a>
9292
{{end}}

templates/user/dashboard/feeds.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
<a href="{{.GetCommentLink ctx}}" class="text truncate issue title">{{(.GetIssueTitle ctx) | ctx.RenderUtils.RenderIssueSimpleTitle}}</a>
111111
{{$comment := index .GetIssueInfos 1}}
112112
{{if $comment}}
113-
<div class="markup tw-text-14">{{ctx.RenderUtils.MarkdownToHtml $comment}}</div>
113+
<div class="render-content markup tw-text-14">{{ctx.RenderUtils.MarkdownToHtml $comment}}</div>
114114
{{end}}
115115
{{else if .GetOpType.InActions "merge_pull_request"}}
116116
<div class="flex-item-body text black">{{index .GetIssueInfos 1}}</div>

templates/user/dashboard/milestones.tmpl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
{{end}}
3434
</div>
3535
</div>
36-
<div class="flex-container-main content">
36+
<div class="flex-container-main">
3737
<div class="list-header">
3838
<div class="small-menu-items ui compact tiny menu list-header-toggle">
3939
<a class="item{{if not .IsShowClosed}} active{{end}}" href="?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=open&q={{$.Keyword}}">
@@ -140,9 +140,7 @@
140140
{{end}}
141141
</div>
142142
{{if .Content}}
143-
<div class="markup content">
144-
{{.RenderedContent}}
145-
</div>
143+
<div class="render-content markup">{{.RenderedContent}}</div>
146144
{{end}}
147145
</li>
148146
{{end}}

0 commit comments

Comments
 (0)