Sha256: 174783e6a871673c5c9cb86777e123ecc85d75b64818be1d0616326794c4d36a

Contents?: true

Size: 578 Bytes

Versions: 4

Compression:

Stored size: 578 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

4 entries across 4 versions & 1 rubygems

Version Path
commonmarker-0.17.8 test/test_footnotes.rb
commonmarker-0.17.7.1 test/test_footnotes.rb
commonmarker-0.17.7 test/test_footnotes.rb
commonmarker-0.17.6 test/test_footnotes.rb