1
0
Fork 0
forked from forgejo/forgejo

Add NeedPostProcess for Parser interface to improve performance of csv render (#15153)

This commit is contained in:
Lunny Xiao 2021-04-13 15:06:31 +08:00 committed by GitHub
parent bf3e584de2
commit 66f0fd0959
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 38 additions and 14 deletions

View file

@ -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),
})
}