redcarpet-3.5.0/0000755000004100000410000000000013520411237013516 5ustar www-datawww-dataredcarpet-3.5.0/COPYING0000644000004100000410000000210413520411237014546 0ustar www-datawww-dataCopyright (c) 2009, Natacha Porté Copyright (c) 2015, Vicent Marti Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. redcarpet-3.5.0/test/0000755000004100000410000000000013520411237014475 5ustar www-datawww-dataredcarpet-3.5.0/test/redcarpet_compat_test.rb0000644000004100000410000000254313520411237021401 0ustar www-datawww-data# coding: UTF-8 require 'test_helper' class RedcarpetCompatTest < Redcarpet::TestCase def test_simple_compat_api html = RedcarpetCompat.new("This is_just_a test").to_html assert_equal "

This isjusta test

\n", html end def test_compat_api_enables_extensions html = RedcarpetCompat.new("This is_just_a test", :no_intra_emphasis).to_html assert_equal "

This is_just_a test

\n", html end def test_compat_api_knows_fenced_code_extension text = "```ruby\nx = 'foo'\n```" html = RedcarpetCompat.new(text, :fenced_code).to_html assert_equal "
x = 'foo'\n
\n", html end def test_compat_api_ignores_gh_blockcode_extension text = "```ruby\nx = 'foo'\n```" html = RedcarpetCompat.new(text, :fenced_code, :gh_blockcode).to_html assert_equal "
x = 'foo'\n
\n", html end def test_compat_api_knows_no_intraemphasis_extension html = RedcarpetCompat.new("This is_just_a test", :no_intraemphasis).to_html assert_equal "

This is_just_a test

\n", html end def test_translate_outdated_extensions # these extensions are no longer used exts = [:gh_blockcode, :no_tables, :smart, :strict] html = RedcarpetCompat.new('"TEST"', *exts).to_html assert_equal "

"TEST"

\n", html end end redcarpet-3.5.0/test/pathological_inputs_test.rb0000644000004100000410000000142613520411237022134 0ustar www-datawww-data# coding: UTF-8 require 'test_helper' # Disabled by default # (these are the easy ones -- the evil ones are not disclosed) class PathologicalInputsTest # < Redcarpet::TestCase def setup @markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML) end def test_pathological_1 star = '*' * 250000 @markdown.render("#{star}#{star} hi #{star}#{star}") end def test_pathological_2 crt = '^' * 255 str = "#{crt}(\\)" @markdown.render("#{str*300}") end def test_pathological_3 c = "`t`t`t`t`t`t" * 20000000 @markdown.render(c) end def test_pathological_4 @markdown.render(" [^a]: #{ "A" * 10000 }\n#{ "[^a][]" * 1000000 }\n") end def test_unbound_recursion @markdown.render(("[" * 10000) + "foo" + ("](bar)" * 10000)) end end redcarpet-3.5.0/test/html_toc_render_test.rb0000644000004100000410000000602013520411237021227 0ustar www-datawww-data# coding: UTF-8 require 'test_helper' class HTMLTOCRenderTest < Redcarpet::TestCase def setup @renderer = Redcarpet::Render::HTML_TOC @markdown = <<-Markdown.strip_heredoc # A title ## A __nice__ subtitle ## Another one ### A sub-sub-title ### 見出し Markdown end def test_simple_toc_render output = render(@markdown) assert output.start_with?("") assert_equal 3, output.scan("