From df13478186a80a28916eba41686d9588ea1cc38e Mon Sep 17 00:00:00 2001 From: zmagod Date: Tue, 9 May 2017 11:25:00 +0200 Subject: [PATCH] fix samples bug [SCI-1241] --- app/helpers/input_sanitize_helper.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/helpers/input_sanitize_helper.rb b/app/helpers/input_sanitize_helper.rb index ce58cc235..79cd54c0d 100644 --- a/app/helpers/input_sanitize_helper.rb +++ b/app/helpers/input_sanitize_helper.rb @@ -16,15 +16,13 @@ module InputSanitizeHelper end def custom_auto_link(text, options = {}) - simple_format = options.fetch(:simple_format) { true } - team = options.fetch(:team) { nil }, + simple_f = options.fetch(:simple_format) { true } + team = options.fetch(:team) { nil } wrapper_tag = options.fetch(:wrapper_tag) { {} } tags = options.fetch(:tags) { [] } - text = if simple_format - simple_format(sanitize_input(text), {}, wrapper_tag) - else - sanitize_input(text, tags) - end + fromat_opt = wrapper_tag.merge(sanitize: false) + text = sanitize_input(text, tags) + text = simple_format(sanitize_input(text), {}, fromat_opt) if simple_f auto_link( smart_annotation_parser(text, team), link: :urls,