diff options
Diffstat (limited to 'modules/markup/markup.go')
-rw-r--r-- | modules/markup/markup.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/markup/markup.go b/modules/markup/markup.go index f8deb2b29b..bc35757775 100644 --- a/modules/markup/markup.go +++ b/modules/markup/markup.go @@ -33,6 +33,7 @@ func Init() { type Parser interface { Name() string // markup format name Extensions() []string + NeedPostProcess() bool Render(rawBytes []byte, urlPrefix string, metas map[string]string, isWiki bool) []byte } @@ -82,10 +83,13 @@ func RenderWiki(filename string, rawBytes []byte, urlPrefix string, metas map[st func render(parser Parser, rawBytes []byte, urlPrefix string, metas map[string]string, isWiki bool) []byte { result := parser.Render(rawBytes, urlPrefix, metas, isWiki) - // TODO: one day the error should be returned. - result, err := PostProcess(result, urlPrefix, metas, isWiki) - if err != nil { - log.Error("PostProcess: %v", err) + if parser.NeedPostProcess() { + var err error + // TODO: one day the error should be returned. + result, err = PostProcess(result, urlPrefix, metas, isWiki) + if err != nil { + log.Error("PostProcess: %v", err) + } } return SanitizeBytes(result) } |