Project

General

Profile

Defect #25634 » fix-defect-25634.diff

patch - Go MAEDA, 2017-05-20 09:14

View differences:

lib/redmine/syntax_highlighting.rb (working copy)
end
def language_supported?(language)
::CodeRay::Scanners.list.include?(language.to_s.downcase.to_sym)
supported_languages =
::CodeRay::Scanners.list +
::CodeRay::Scanners.plugin_hash.keys.map(&:to_sym)
supported_languages.include?(language.to_s.downcase.to_sym)
rescue
false
end
test/unit/helpers/application_helper_test.rb (working copy)
assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(raw).gsub(%r{[\r\n\t]}, '')
end
def test_syntax_highlight_by_coderay_alias
raw = <<-RAW
<pre><code class="ecma_script">
alert("hello, world");
</code></pre>
RAW
expected = <<-EXPECTED
<pre><code class=\"ecma_script syntaxhl\"><span class=\"CodeRay\">alert(<span class=\"string\"><span class=\"delimiter\">&quot;</span><span class=\"content\">hello, world</span><span class=\"delimiter\">&quot;</span></span>);</span></code></pre>
EXPECTED
assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(raw).gsub(%r{[\r\n\t]}, '')
end
def test_to_path_param
assert_equal 'test1/test2', to_path_param('test1/test2')
assert_equal 'test1/test2', to_path_param('/test1/test2/')
(3-3/3)