How to mark as not safe only the variable that is passed into the translation method, when using i18n
gem in Ruby on Rails framework?
For example:
t(
'safe',
default: 'Unsafe <b>%{unsafe_variable}</b> and safe %{safe_variable}',
unsafe_variable: "<script>alert('unsafe');</script>",
safe_variable: '<strong>safe</strong>'
)
Should return
Unsafe <b><script>alert('unsafe');</script></b> and safe <strong>safe</strong>