File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ * Avoid mutating the options hash passed to a render object.
4+
5+ Refs #663 .
6+
7+ * Max Schwenk*
8+
39* Fix a segfault rendering quotes using ` StripDown ` and the ` :quote `
410 option.
511
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ def test_simple_overload
2323 end
2424
2525 def test_renderer_options
26- parser = Redcarpet ::Markdown . new ( SimpleRender . new ( { with_toc_data : true } . freeze ) , { } )
26+ parser = Redcarpet ::Markdown . new ( SimpleRender . new ( with_toc_data : true ) )
2727 output = parser . render ( "# A title" )
2828
2929 assert_match "My little poney" , output
@@ -36,6 +36,16 @@ def test_markdown_options
3636 assert_match "no_intra_emphasis" , output
3737 end
3838
39+ def test_original_options_hash_is_not_mutated
40+ options = { with_toc_data : true }
41+ render = SimpleRender . new ( options )
42+ parser = Redcarpet ::Markdown . new ( render , tables : true )
43+
44+ computed_options = render . instance_variable_get ( :"@options" )
45+
46+ refute_equal computed_options . object_id , options . object_id
47+ end
48+
3949 class NilPreprocessRenderer < Redcarpet ::Render ::HTML
4050 def preprocess ( fulldoc )
4151 nil
You can’t perform that action at this time.
0 commit comments