From 03fe6b7dd203fb42af0e9a4eea7f91d65acd3317 Mon Sep 17 00:00:00 2001 From: tibvdm Date: Fri, 25 Aug 2023 13:29:41 +0200 Subject: [PATCH] fix test + linting errors --- app/helpers/application_helper.rb | 8 ++++---- test/helpers/application_helper_test.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cd256888db..89f54ca91f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -145,11 +145,11 @@ def markdown_unsafe(source) def sanitize(html) @tags ||= Rails::Html::SafeListSanitizer.allowed_tags.to_a + - %w[table thead tbody tr td th colgroup col style summary details] + - %w[svg g style circle line rect path polygon text] + %w[table thead tbody tr td th colgroup col style summary details] + + %w[svg g style circle line rect path polygon text] @attributes ||= Rails::Html::SafeListSanitizer.allowed_attributes.to_a + - %w[style target data-bs-toggle data-parent data-tab data-line data-element id] + - %w[viewbox width height version style class transform id x y rx ry x1 y1 x2 y2 d points fill stroke stroke-width cx cy r font-size font-family font-weight font-variant] + %w[style target data-bs-toggle data-parent data-tab data-line data-element id] + + %w[viewbox width height version style class transform id x y rx ry x1 y1 x2 y2 d points fill stroke stroke-width cx cy r font-size font-family font-weight font-variant] # Filters allowed tags and attributes sanitized = ActionController::Base.helpers.sanitize html, diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index bb6bf9336a..95dfa15373 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -98,7 +98,7 @@ class ApplicationHelperTest < ActiveSupport::TestCase test 'sanitize helper should allow a selection of svg tags' do dirty_html = <<~HTML - +