diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-04-13 15:06:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-13 15:06:31 +0800 |
commit | 66f0fd0959b293c01a7685e9d7858db1da4416da (patch) | |
tree | fbe5b537bbe9361ab3e7067c6d583230bf45db77 /modules/setting/markup.go | |
parent | bf3e584de25b43ddc8fd12d1388fbd9b984f883b (diff) | |
download | gitea-66f0fd0959b293c01a7685e9d7858db1da4416da.tar.gz gitea-66f0fd0959b293c01a7685e9d7858db1da4416da.zip |
Add NeedPostProcess for Parser interface to improve performance of csv render (#15153)
Diffstat (limited to 'modules/setting/markup.go')
-rw-r--r-- | modules/setting/markup.go | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/modules/setting/markup.go b/modules/setting/markup.go index 1dd76243e6..36cba68262 100644 --- a/modules/setting/markup.go +++ b/modules/setting/markup.go @@ -21,11 +21,12 @@ var ( // MarkupParser defines the external parser configured in ini type MarkupParser struct { - Enabled bool - MarkupName string - Command string - FileExtensions []string - IsInputFile bool + Enabled bool + MarkupName string + Command string + FileExtensions []string + IsInputFile bool + NeedPostProcess bool } // MarkupSanitizerRule defines the policy for whitelisting attributes on @@ -124,10 +125,11 @@ func newMarkupRenderer(name string, sec *ini.Section) { } ExternalMarkupParsers = append(ExternalMarkupParsers, MarkupParser{ - Enabled: sec.Key("ENABLED").MustBool(false), - MarkupName: name, - FileExtensions: exts, - Command: command, - IsInputFile: sec.Key("IS_INPUT_FILE").MustBool(false), + Enabled: sec.Key("ENABLED").MustBool(false), + MarkupName: name, + FileExtensions: exts, + Command: command, + IsInputFile: sec.Key("IS_INPUT_FILE").MustBool(false), + NeedPostProcess: sec.Key("NEED_POSTPROCESS").MustBool(true), }) } |