(cfg *config.Config, c *Collection, isOwner bool, isPostPage bool)
| 74 | } |
| 75 | |
| 76 | func (p *Post) formatContent(cfg *config.Config, c *Collection, isOwner bool, isPostPage bool) { |
| 77 | baseURL := c.CanonicalURL() |
| 78 | // TODO: redundant |
| 79 | if !isSingleUser { |
| 80 | baseURL = "/" + c.Alias + "/" |
| 81 | } |
| 82 | |
| 83 | p.handlePremiumContent(c, isOwner, isPostPage, cfg) |
| 84 | p.Content = strings.Replace(p.Content, "<!--paid-->", "<!--paid-->", 1) |
| 85 | |
| 86 | p.HTMLTitle = template.HTML(applyBasicMarkdown([]byte(p.Title.String))) |
| 87 | p.HTMLContent = template.HTML(applyMarkdown([]byte(p.Content), baseURL, cfg)) |
| 88 | if exc := strings.Index(string(p.Content), "<!--more-->"); exc > -1 { |
| 89 | p.HTMLExcerpt = template.HTML(applyMarkdown([]byte(p.Content[:exc]), baseURL, cfg)) |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | func (p *PublicPost) formatContent(cfg *config.Config, isOwner bool, isPostPage bool) { |
| 94 | p.Post.formatContent(cfg, &p.Collection.Collection, isOwner, isPostPage) |
no test coverage detected