diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-05-26 01:15:39 +0800 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-05-25 18:15:39 +0100 |
commit | 355ab0c62c1d58200d68e30d112db398ea00297a (patch) | |
tree | 15acaf368cbf16ffd2fc2102c13ca9536f5a0145 /modules/markup | |
parent | 0c432d26fe20d3e50da566cf75fa483376ed8bef (diff) | |
download | gitea-355ab0c62c1d58200d68e30d112db398ea00297a.tar.gz gitea-355ab0c62c1d58200d68e30d112db398ea00297a.zip |
Fix wrong init dependency on markup extensions (#7038)
* fix wrong init dependency on markup extensions
Diffstat (limited to 'modules/markup')
-rw-r--r-- | modules/markup/markup.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/markup/markup.go b/modules/markup/markup.go index 0ea4099600..dc43b533c0 100644 --- a/modules/markup/markup.go +++ b/modules/markup/markup.go @@ -15,6 +15,14 @@ import ( func Init() { getIssueFullPattern() NewSanitizer() + + // since setting maybe changed extensions, this will reload all parser extensions mapping + extParsers = make(map[string]Parser) + for _, parser := range parsers { + for _, ext := range parser.Extensions() { + extParsers[strings.ToLower(ext)] = parser + } + } } // Parser defines an interface for parsering markup file to HTML |