ActionView::Helpers::SanitizeHelper
def sanitize_css(style)

Description

Returns the string with disallowed CSS declarations removed.

Arguments

Changing a value updates the ERB and HTML.

Removes CSS declarations that are not in the allow list (such as position) and those containing url(…). Also removes disallowed functions in values (such as expression()) and disallowed keywords for properties such as margin, removing the declaration if nothing is left. Joins the rest without spaces. The allow list is Loofah's Loofah::HTML5::SafeList (ALLOWED_CSS_PROPERTIES, etc.), which no Rails setting changes.

ERB

Changes from the previous output: Added Removed Changed


          

HTML