class Sanitize::CSS
def at_rule!(rule)
Sanitizes a CSS at-rule node. Returns the sanitized node, or `nil` if the
def at_rule!(rule) name = rule[:name].downcase if @at_rules_with_styles.include?(name) styles = Crass::Parser.parse_rules(rule[:block], preserve_comments: @config[:allow_comments], preserve_hacks: @config[:allow_hacks]) rule[:block] = tree!(styles) elsif @at_rules_with_properties.include?(name) props = Crass::Parser.parse_properties(rule[:block], preserve_comments: @config[:allow_comments], preserve_hacks: @config[:allow_hacks]) rule[:block] = tree!(props) elsif @at_rules.include?(name) return nil if name == "import" && !import_url_allowed?(rule) return nil if rule.has_key?(:block) else return nil end rule end