Sha256: d2bbcfe500bb17c8b2f1aa01ae9d1ef58b0777e585007de280f26edeef1ac48b

Contents?: true

Size: 660 Bytes

Versions: 20

Compression:

Stored size: 660 Bytes

Contents

# coding: UTF-8
require 'test_helper'

class CustomRenderTest < Redcarpet::TestCase
  class SimpleRender < Redcarpet::Render::HTML
    def emphasis(text)
      "<em class=\"cool\">#{text}</em>"
    end
  end

  def test_simple_overload
    md = Redcarpet::Markdown.new(SimpleRender)
    assert_equal "<p>This is <em class=\"cool\">just</em> a test</p>\n",
      md.render("This is *just* a test")
  end

  class NilPreprocessRenderer < Redcarpet::Render::HTML
    def preprocess(fulldoc)
      nil
    end
  end

  def test_preprocess_returning_nil
    md = Redcarpet::Markdown.new(NilPreprocessRenderer)
    assert_equal(nil,md.render("Anything"))
  end

end

Version data entries

20 entries across 20 versions & 5 rubygems

Version Path
mumukit-content-type-1.11.1 vendor/bundle/ruby/2.6.0/gems/redcarpet-3.3.4/test/custom_render_test.rb
tdiary-5.0.2 vendor/bundle/gems/redcarpet-3.3.4/test/custom_render_test.rb
tdiary-5.0.1 vendor/bundle/gems/redcarpet-3.3.4/test/custom_render_test.rb
redcarpet_yt-0.1.0 test/custom_render_test.rb
redcarpet_yt-0.0.10 test/custom_render_test.rb
redcarpet_yt-0.0.9 test/custom_render_test.rb
redcarpet_yt-0.0.8 test/custom_render_test.rb
redcarpet_yt-0.0.7 test/custom_render_test.rb
redcarpet_yt-0.0.6 test/custom_render_test.rb
redcarpet_yt-0.0.5 test/custom_render_test.rb
redcarpet_yt-0.0.4 test/custom_render_test.rb
redcarpet_yt-0.0.3 test/custom_render_test.rb
redcarpet_yt-0.0.2 test/custom_render_test.rb
redcarpet_yt-0.0.1 test/custom_render_test.rb
redcarpet-3.3.4 test/custom_render_test.rb
redcarpet-3.3.3 test/custom_render_test.rb
tight-redcarpet-3.3.2t test/custom_render_test.rb
redcarpet-3.3.2 test/custom_render_test.rb
redcarpet-3.3.1 test/custom_render_test.rb
redcarpet-3.3.0 test/custom_render_test.rb