Sha256: b0d0fddae772c50c6cee57226b50df8985d2fe0f9c4ab74de1191df83c08207f

Contents?: true

Size: 763 Bytes

Versions: 14

Compression:

Stored size: 763 Bytes

Contents

require 'test_helper'

class TestRenderer < Minitest::Test
  def setup
    @doc = CommonMarker.render_doc('Hi *there*')
  end

  def test_html_renderer
    renderer = HtmlRenderer.new
    result = renderer.render(@doc)
    assert_equal "<p>Hi <em>there</em></p>\n", result
  end

  def test_multiple_tables
    content = '''
| Input       | Expected         | Actual    |
| ----------- | ---------------- | --------- |
| One         | Two              | Three     |

| Header   | Row  | Example |
| :------: | ---: | :------ |
| Foo      | Bar  | Baz     |
'''
    doc = CommonMarker.render_doc(content, :DEFAULT, [:autolink, :table, :tagfilter])
    results = CommonMarker::HtmlRenderer.new.render(doc)
    assert_equal 2, results.scan(/<tbody>/).size
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
commonmarker-0.18.2 test/test_renderer.rb
commonmarker-0.18.1 test/test_renderer.rb
commonmarker-0.18.0 test/test_renderer.rb
commonmarker-0.17.13 test/test_renderer.rb
commonmarker-0.17.12 test/test_renderer.rb
commonmarker-0.17.11 test/test_renderer.rb
commonmarker-0.17.10 test/test_renderer.rb
tdiary-5.0.8 vendor/bundle/gems/commonmarker-0.17.9/test/test_renderer.rb
commonmarker-0.17.9 test/test_renderer.rb
commonmarker-0.17.8 test/test_renderer.rb
commonmarker-0.17.7.1 test/test_renderer.rb
commonmarker-0.17.7 test/test_renderer.rb
commonmarker-0.17.6 test/test_renderer.rb
commonmarker-0.17.5 test/test_renderer.rb