mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-04 03:36:44 +08:00
Allow data attr in sanitize config [SCI-9464]
This commit is contained in:
parent
3cf3d799f6
commit
d68d7af529
2 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,6 @@ module InputSanitizeHelper
|
|||
|
||||
# allow base64 images when sanitizing if base64_encoded_imgs is true
|
||||
sanitizer_config = Constants::INPUT_SANITIZE_CONFIG.deep_dup
|
||||
sanitizer_config[:protocols]['img']['src'] << 'data' if options.fetch(:base64_encoded_imgs, false)
|
||||
text = sanitize_input(text, tags, sanitizer_config: sanitizer_config)
|
||||
|
||||
if text =~ SmartAnnotations::TagToHtml::USER_REGEX || text =~ SmartAnnotations::TagToHtml::REGEX
|
||||
|
|
|
@ -325,6 +325,7 @@ class Constants
|
|||
config[:attributes][:all] << 'id'
|
||||
config[:attributes][:all] << 'contenteditable'
|
||||
config[:attributes][:all] << :data
|
||||
config[:protocols]['img']['src'] << 'data'
|
||||
INPUT_SANITIZE_CONFIG = Sanitize::Config.freeze_config(config)
|
||||
|
||||
REPOSITORY_DEFAULT_PAGE_SIZE = 10
|
||||
|
|
Loading…
Reference in a new issue