Render HTML entities in Drafts list

Previously, we'd show the raw HTML entities in the summaries of Draft
posts, instead of rendering them. This fixes that.
pull/248/head
Matt Baer 5 years ago
parent b9914dd65a
commit b336e95e12
  1. 4
      posts.go
  2. 2
      templates/user/articles.tmpl

@ -229,6 +229,10 @@ func (p Post) Summary() string {
return shortPostDescription(p.Content)
}
func (p Post) SummaryHTML() template.HTML {
return template.HTML(p.Summary())
}
// Excerpt shows any text that comes before a (more) tag.
// TODO: use HTMLExcerpt in templates instead of this method
func (p *Post) Excerpt() template.HTML {

@ -34,7 +34,7 @@
{{end}}
{{ end }}
</h4>
{{if .Summary}}<p>{{.Summary}}</p>{{end}}
{{if .Summary}}<p>{{.SummaryHTML}}</p>{{end}}
</div>{{end}}
</div>{{ else }}<div id="no-posts-published"><p>You haven't saved any drafts yet.</p>
<p>They'll show up here once you do. {{if not .SingleUser}}Find your blog posts from the <a href="/me/c/">Blogs</a> page.{{end}}</p>

Loading…
Cancel
Save