From 361cc0515aea77de9905140f6fc2546812b5dc05 Mon Sep 17 00:00:00 2001 From: Michael Scrivo Date: Wed, 6 Jan 2021 11:49:22 -0500 Subject: [PATCH] Fix warning in Ruby 2.7+ This fixes the following warning when creating your own transformer like so: ```ruby class SomeTransformer def call(node:, **_) { node_allowlist: [node], } end end ``` ``` /usr/local/bundle/ruby/2.7.0/gems/sanitize-5.2.1/lib/sanitize.rb:207: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call ``` --- lib/sanitize.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sanitize.rb b/lib/sanitize.rb index 8b71696..561c180 100644 --- a/lib/sanitize.rb +++ b/lib/sanitize.rb @@ -204,7 +204,7 @@ def transform_node!(node, node_allowlist) config[:node_name] = node.name.downcase config[:node_allowlist] = config[:node_whitelist] = node_allowlist - result = transformer.call(config) + result = transformer.call(**config) if result.is_a?(Hash) result_allowlist = result[:node_allowlist] || result[:node_whitelist]