diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-03-06 16:41:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-06 16:41:54 +0800 |
commit | b24e8d38af21fc1857b6aa66351627e3b1761608 (patch) | |
tree | 4b021069697a852808f9a1e9ee7e89ab7b2a42a5 /modules/setting | |
parent | 3e28fa72cedc559e0dc3396d0676a5d1dab12624 (diff) | |
download | gitea-b24e8d38af21fc1857b6aa66351627e3b1761608.tar.gz gitea-b24e8d38af21fc1857b6aa66351627e3b1761608.zip |
Support ignore all santize for external renderer (#18984)
* Support ignore all santize for external renderer
* Update docs
* Apply suggestions from code review
Co-authored-by: silverwind <me@silverwind.io>
* Fix doc
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/markup.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/setting/markup.go b/modules/setting/markup.go index 09b86b9b1a..5fb6af6838 100644 --- a/modules/setting/markup.go +++ b/modules/setting/markup.go @@ -29,6 +29,7 @@ type MarkupRenderer struct { IsInputFile bool NeedPostProcess bool MarkupSanitizerRules []MarkupSanitizerRule + DisableSanitizer bool } // MarkupSanitizerRule defines the policy for whitelisting attributes on @@ -144,11 +145,12 @@ func newMarkupRenderer(name string, sec *ini.Section) { } ExternalMarkupRenderers = append(ExternalMarkupRenderers, &MarkupRenderer{ - 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), + 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), + DisableSanitizer: sec.Key("DISABLE_SANITIZER").MustBool(false), }) } |