func (h htmlHandler) Extensions() []string { return []string{"html", "htm"} }
func (h htmlHandler) PageConvert(p *Page, t tpl.Template) HandledResult {
- // see #674 - disabled by bjornerik for now
- // p.ProcessShortcodes(t)
- p.Content = helpers.BytesToHTML(p.rawContent)
+ p.ProcessShortcodes(t)
+ var content []byte
+ var err error
+
+ if len(p.contentShortCodes) > 0 {
+ content, err = replaceShortcodeTokens(p.rawContent, shortcodePlaceholderPrefix, true, p.contentShortCodes)
+
+ if err != nil {
+ jww.FATAL.Printf("Fail to replace shortcode tokens in %s:\n%s", p.BaseFileName(), err.Error())
+ return HandledResult{err: err}
+ }
+ } else {
+ content = p.rawContent
+ }
+
+ p.Content = helpers.BytesToHTML(content)
return HandledResult{err: nil}
}