You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this case, i18n_text is a string returned by I18n.translate, which may or may not include HTML, and i18n_mode_additional_markup(key) returns the following string:
Tagging a string as html safe may be a security risk, prefer safe_join or other Rails tag helpers instead.
safe_join([raw(i18n_text), raw(i18n_mode_additional_markup(key))])
Steps to reproduce the problem
Call .html_safe and/or raw inside a safe_join call.
RuboCop version
Include the output of rubocop -V. Here's an example:
Scenario: Elements inside a
safe_join
call includeraw
orhtml_safe
, such as:or
In this case,
i18n_text
is a string returned byI18n.translate
, which may or may not include HTML, andi18n_mode_additional_markup(key)
returns the following string:I also tried the
content_tag
version:Expected behavior
Given that the Rails documentation for
safe_join
shows examples withraw
, I would expect that would be accepted.Actual behavior
Rubocop flags this as an offense:
Steps to reproduce the problem
Call
.html_safe
and/orraw
inside asafe_join
call.RuboCop version
Include the output of
rubocop -V
. Here's an example:The text was updated successfully, but these errors were encountered: