tclip/cmd/web/tmpl/showpaste.tmpl
Xe Iaso dc69c0cd81 cmd/web: add markdown processing
This uses the library blackfriday[1] to convert markdown to HTML. This
is a naive implementation, but it will do for now.

[1]: https://pkg.go.dev/github.com/russross/blackfriday

Signed-off-by: Xe Iaso <xe@tailscale.com>
2023-02-23 19:58:37 +00:00

28 lines
796 B
Cheetah

{{template "header" .}}
<script src="/static/js/prism.js"></script>
{{if .UserInfo}}
{{if ne .PasterUserID .UserID}}
<div class="right">{{.PasterDisplayName}} <img style="width:32px;height:32px" src="{{.PasterProfilePicURL}}" /></div>
{{end}}
{{else}}
<div class="right">{{.PasterDisplayName}} <img style="width:32px;height:32px" src="{{.PasterProfilePicURL}}" /></div>
{{end}}
<p>Created at {{.CreatedAt}}</p>
{{if .RawHTML}}
{{.RawHTML}}
<br />
{{else}}
<div style="display:inline-block;">
<pre><code class="{{.CSSClass}}">{{.Data}}
</code></pre>
</div>
{{end}}
<a href="/paste/{{.ID}}">Permalink</a> - <a href="/paste/{{.ID}}/dl">Download</a> - <a href="/paste/{{.ID}}/raw">Raw</a>{{if eq .UserID .PasterUserID}} - <a href="/api/delete/{{.ID}}">Delete</a>{{end}}
{{template "footer" .}}