Sha256: e4564dcd083afef7f43144ce81c2b14d1cf2c953220c0cd3f7f91ca77fb3d263
Contents?: true
Size: 807 Bytes
Versions: 71
Compression:
Stored size: 807 Bytes
Contents
require 'test_helper' class SafeRenderTest < Redcarpet::TestCase def setup @renderer = Redcarpet::Render::Safe end def test_safe_links_only_is_enabled_by_default markdown = "[foo](javascript:alert('foo'))" output = render(markdown) assert_not_match %r{a href}, output end def test_escape_html_is_enabled_by_default markdown = "<p>Hello world!</p>" output = render(markdown) assert_match %r{<}, output end def test_html_escaping_in_code_blocks markdown = "~~~\n<p>Hello!</p>\n~~~" output = render(markdown) assert_match %r{<p>}, output end def test_lang_class_is_removed markdown = "~~~ruby\nclass Foo; end\n~~~" output = render(markdown, with: [:fenced_code_blocks]) assert_not_match %r{ruby}, output end end
Version data entries
71 entries across 56 versions & 9 rubygems