hugolib: Handle any errors in processShortcodes

This commit is contained in:
Bjørn Erik Pedersen
2017-05-06 10:48:27 +02:00
parent 2bcbf10400
commit e951d65771
2 changed files with 13 additions and 4 deletions

View File

@@ -1371,11 +1371,16 @@ func (p *Page) SaveSource() error {
return p.SaveSourceAs(p.FullFilePath())
}
func (p *Page) ProcessShortcodes() {
func (p *Page) processShortcodes() error {
p.shortcodeState = newShortcodeHandler()
tmpContent, _ := p.shortcodeState.extractAndRenderShortcodes(string(p.workContent), p)
tmpContent, err := p.shortcodeState.extractAndRenderShortcodes(string(p.workContent), p)
if err != nil {
return err
}
p.workContent = []byte(tmpContent)
return nil
}
func (p *Page) FullFilePath() string {