Exemple #1
0
func (a *Article) Content() template.HTML {
	if a.BodyType == PAGE_BODY_MARKDOWN {
		body := strings.Replace(a.Body, "<!--more-->", "\n", -1)
		body = strings.Replace(body, "[more]", "\n", -1)
		return utils.Markdown2HTML(body)
	}
	return template.HTML(a.Body)
}
Exemple #2
0
func (a *Article) PreviewContent() template.HTML {
	if a.BodyType == PAGE_BODY_MARKDOWN {
		return utils.Markdown2HTML(a.Preview)
	}
	return template.HTML(a.Preview)
}