Sha256: 622f692b2deabd645ba0f588c4b4b06408ea588395bebc35e1f8d84961fbb97a

Contents?: true

Size: 576 Bytes

Versions: 9

Compression:

Stored size: 576 Bytes

Contents

require 'test_helper'

class TestFootnotes < Minitest::Test
  def setup
    @doc = CommonMarker.render_doc("Hello[^hi].\n\n[^hi]: Hey!\n", :FOOTNOTES)
    @expected = <<-HTML
<p>Hello<sup class="footnote-ref"><a href="#fn1" id="fnref1">1</a></sup>.</p>
<section class="footnotes">
<ol>
<li id="fn1">
<p>Hey! <a href="#fnref1" class="footnote-backref">↩</a></p>
</li>
</ol>
</section>
    HTML
  end

  def test_to_html
    assert_equal @expected, @doc.to_html
  end

  def test_html_renderer
    assert_equal @expected, CommonMarker::HtmlRenderer.new.render(@doc)
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
commonmarker-0.18.2 test/test_footnotes.rb
commonmarker-0.18.1 test/test_footnotes.rb
commonmarker-0.18.0 test/test_footnotes.rb
commonmarker-0.17.13 test/test_footnotes.rb
commonmarker-0.17.12 test/test_footnotes.rb
commonmarker-0.17.11 test/test_footnotes.rb
commonmarker-0.17.10 test/test_footnotes.rb
tdiary-5.0.8 vendor/bundle/gems/commonmarker-0.17.9/test/test_footnotes.rb
commonmarker-0.17.9 test/test_footnotes.rb