forked from forgejo/forgejo
Markdown rendering overhaul (#186)
* Markdown rendering overhaul Cleaned up and squashed commits into single one. Signed-off-by: Andrew Boyarshin <boyarshinand@gmail.com> * Fix markdown API, add markdown module and API tests, improve code coverage Signed-off-by: Andrew Boyarshin <boyarshinand@gmail.com>
This commit is contained in:
parent
5cc275b1de
commit
dc8248f8a4
13 changed files with 1374 additions and 187 deletions
|
@ -4,9 +4,11 @@
|
|||
<div class="ui container">
|
||||
<div class="ui header">
|
||||
{{.i18n.Tr "repo.wiki.pages"}}
|
||||
{{if and .IsRepositoryWriter (not .IsRepositoryMirror)}}
|
||||
<div class="ui right">
|
||||
<a class="ui green small button" href="{{.RepoLink}}/wiki/_new">{{.i18n.Tr "repo.wiki.new_page_button"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<table class="ui table">
|
||||
<tbody>
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui dividing header">
|
||||
<div class="ui header">
|
||||
{{.title}}
|
||||
{{if and .IsRepositoryWriter (not .Repository.IsMirror)}}
|
||||
<div class="ui right">
|
||||
|
@ -64,9 +64,28 @@
|
|||
{{.i18n.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince | Safe}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui segment markdown">
|
||||
{{.content | Str2html}}
|
||||
{{if .FormatWarning}}
|
||||
<div class="ui negative message">
|
||||
<p>{{.FormatWarning}}</p>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="ui {{if .sidebarPresent}}grid equal width{{end}}" style="margin-top: 1rem;">
|
||||
<div class="ui {{if .sidebarPresent}}eleven wide column{{end}} segment markdown">
|
||||
{{.content | Str2html}}
|
||||
</div>
|
||||
{{if .sidebarPresent}}
|
||||
<div class="column" style="padding-top: 0;">
|
||||
<div class="ui segment">
|
||||
{{.sidebarContent | Str2html}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if .footerPresent}}
|
||||
<div class="ui grey segment">
|
||||
{{.footerContent | Str2html}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue