From e8f25f2095ecd094266b5f5ab552f96d4f3d3bf4 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sun, 12 Mar 2023 19:13:25 -0700 Subject: [PATCH] Fix deprecated interface for YAML.safe_load Passing in the permitted classes as the second argument was deprecated in Psych 3 (https://github.com/ruby/psych/pull/378) and removed in Psych 4 (https://github.com/ruby/psych/pull/487). Ruby 3.1 ships with Psych 4, so to make the code work for Ruby 2.7 and up, use the `permitted_classes` keyword argument. --- bin/kramdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/kramdown b/bin/kramdown index e1128abe..ed8b23de 100755 --- a/bin/kramdown +++ b/bin/kramdown @@ -111,7 +111,7 @@ end.parse! begin if config_file && File.exist?(config_file) - config_file_options = YAML.safe_load(File.read(config_file), [Symbol]) + config_file_options = YAML.safe_load(File.read(config_file), permitted_classes: [Symbol]) case config_file_options when nil # empty configuration file except perhaps YAML header and comments # Nothing to do