mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-07 07:26:20 +08:00
53699193a2
Conflicts: app/assets/javascripts/comments.js.erb app/assets/javascripts/protocols/index.js app/assets/javascripts/protocols/steps.js.erb app/assets/javascripts/samples/sample_datatable.js.erb app/controllers/my_module_comments_controller.rb app/controllers/project_comments_controller.rb app/controllers/result_comments_controller.rb app/controllers/step_comments_controller.rb app/datatables/sample_datatable.rb app/views/my_module_comments/_comment.html.erb app/views/project_comments/_comment.html.erb app/views/projects/show/_experiment.html.erb app/views/reports/elements/_experiment_element.html.erb app/views/reports/elements/_result_comments_element.html.erb app/views/reports/elements/_result_text_element.html.erb app/views/reports/elements/_step_checklist_element.html.erb app/views/reports/elements/_step_comments_element.html.erb app/views/reports/elements/_step_element.html.erb app/views/result_comments/_comment.html.erb app/views/results/_result_text.html.erb app/views/step_comments/_comment.html.erb app/views/steps/_step.html.erb db/schema.rb
18 lines
396 B
Ruby
18 lines
396 B
Ruby
module InputSanitizeHelper
|
|
def sanitize_input(text)
|
|
ActionController::Base.helpers.sanitize(
|
|
text,
|
|
tags: Constants::WHITELISTED_TAGS,
|
|
attributes: Constants::WHITELISTED_ATTRIBUTES
|
|
)
|
|
end
|
|
|
|
def escape_input(text)
|
|
ERB::Util.html_escape(text)
|
|
end
|
|
|
|
def custom_auto_link(text, args)
|
|
args[:sanitize] = false
|
|
auto_link(sanitize_input(text), args)
|
|
end
|
|
end
|