Action Text Sanitizer update to more inclusive language

How I went about updating my Action Text allowed tags/attributes

Now that we are rightly as a community removing references in Rails to language such as blacklist and whitelist, I thought I would share how I updated my action_text.rb file to use more inclusive terms that are now available in Rails.

Before I had to use:

Rails::Html::WhiteListSanitizer.allowed_tags << 'iframe’

And this is now able to be:

Rails::Html::Sanitizer.safe_list_sanitizer.allowed_tags << 'iframe’

You may find that if you update Rubocop you will be alerted to Naming/InclusiveLanguage: Consider replacing problematic term 'WhiteList' with 'allowlist' or 'permit’. in this file.

Recent posts View all

Freelancing

Getting the most out of your agency

Here are some tips based on years of working with, for, and as an agency on how to get the most out of any work you do.

VS Code Web Dev

Select multiple lines in VS Code

How to select multiple lines to edit at once within VS Code