summaryrefslogtreecommitdiffstats
path: root/modules/markup/markup.go
diff options
context:
space:
mode:
authorMorgan Bazalgette <git@howl.moe>2018-02-27 08:09:18 +0100
committerLauris BH <lauris@nix.lv>2018-02-27 09:09:18 +0200
commit535445c32ee730988033728b3b91c4d6f456e08c (patch)
tree34cd5b9807faf01018f47f74a34ed5b584df5158 /modules/markup/markup.go
parent769ab1e4240f820efdb231832cb7957cb4902807 (diff)
downloadgitea-535445c32ee730988033728b3b91c4d6f456e08c.tar.gz
gitea-535445c32ee730988033728b3b91c4d6f456e08c.zip
Rework special link parsing in the post-processing of markup (#3354)
* Get rid of autolink * autolink in markdown * Replace email addresses with mailto links * better handling of links * Remove autolink.js from footer * Refactor entire html.go * fix some bugs * Make tests green, move what we can to html_internal_test, various other changes to processor logic * Make markdown tests work again This is just a description to allow me to force push in order to restart the drone build. * Fix failing markdown tests in routers/api/v1/misc * Add license headers, log errors, future-proof <body> * fix formatting
Diffstat (limited to 'modules/markup/markup.go')
-rw-r--r--modules/markup/markup.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/markup/markup.go b/modules/markup/markup.go
index ba28ec53c0..d17270fb01 100644
--- a/modules/markup/markup.go
+++ b/modules/markup/markup.go
@@ -7,6 +7,8 @@ package markup
import (
"path/filepath"
"strings"
+
+ "code.gitea.io/gitea/modules/log"
)
// Init initialize regexps for markdown parsing
@@ -69,7 +71,11 @@ 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 {
urlPrefix = strings.Replace(urlPrefix, " ", "+", -1)
result := parser.Render(rawBytes, urlPrefix, metas, isWiki)
- result = PostProcess(result, urlPrefix, metas, isWiki)
+ // TODO: one day the error should be returned.
+ result, err := PostProcess(result, urlPrefix, metas, isWiki)
+ if err != nil {
+ log.Error(3, "PostProcess: %v", err)
+ }
return SanitizeBytes(result)
}