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
Jeremy Baker edited this page Jun 20, 2015
·
3 revisions
In order to support Data URIs, just add the protocol to the config. For example:
# Create a customized copy of the Relaxed config, adding data to the# existing whitelisted protocols.Sanitize.fragment(html,Sanitize::Config.merge(Sanitize::Config::RELAXED,:protocols=>{'img'=>{'src'=>['http','https','data',:relative]}}))
NOTE: The use of string keys (instead of symbols img:) is critical for the merge to apply properly.