28 lines
937 B
Diff
28 lines
937 B
Diff
|
|
From 74f71ccf296c2b01e1a8455b4107b02316a7c7fb Mon Sep 17 00:00:00 2001
|
||
|
|
From: Peter Zhang <zpregister@gmail.com>
|
||
|
|
Date: Sat, 21 Mar 2020 00:38:14 +0100
|
||
|
|
Subject: add a condition to avoid FrozenError
|
||
|
|
|
||
|
|
nil.to_s in Ruby 2.7.0 now always return a frozen String ""
|
||
|
|
a=nil.to_s
|
||
|
|
a.gsub!(//,'')
|
||
|
|
will raise a FrozenError (can't modify frozen String: "")
|
||
|
|
---
|
||
|
|
lib/wikicloth/wiki_buffer/var.rb | 2 +-
|
||
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
|
||
|
|
diff --git a/lib/wikicloth/wiki_buffer/var.rb b/lib/wikicloth/wiki_buffer/var.rb
|
||
|
|
index 2e0f5d1..7a39527 100644
|
||
|
|
--- a/lib/wikicloth/wiki_buffer/var.rb
|
||
|
|
+++ b/lib/wikicloth/wiki_buffer/var.rb
|
||
|
|
@@ -80,7 +80,7 @@ def to_html
|
||
|
|
|
||
|
|
ret = @options[:link_handler].include_resource(key,key_options).to_s
|
||
|
|
|
||
|
|
- ret.gsub!(/<!--(.|\s)*?-->/,"")
|
||
|
|
+ ret.gsub!(/<!--(.|\s)*?-->/,"") unless ret.frozen?
|
||
|
|
count = 0
|
||
|
|
tag_attr = key_options.collect { |p|
|
||
|
|
if p.instance_of?(Hash)
|
||
|
|
|