This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| check_css = lambda { |env| | |
| node = env[:node] | |
| node_name = env[:node_name] | |
| # Don't continue if this node is already whitelisted or is not an element. | |
| return if env[:is_whitelisted] || !node.element? | |
| parent = node.parent | |
| return unless node_name == 'style' || node['style'] | |
| if node_name == 'style' | |
| unless good_css? node.content | |
| node.unlink |