# frozen_string_literal: true require 'test_helper' class TestFootnotes < Minitest::Test def setup @doc = CommonMarker.render_doc("Hello[^hi].\n\n[^hi]: Hey!\n", :FOOTNOTES) end def test_to_html expected = <<~HTML

Hello1.

  1. Hey!

HTML assert_equal expected, @doc.to_html end def test_html_renderer expected = <<~HTML

Hello1.

  1. Hey!

HTML assert_equal expected, CommonMarker::HtmlRenderer.new.render(@doc) end def test_render_html md = <<~MARKDOWN # footnotes Let's render some footnotes[^1] [^1]: This is a footnote MARKDOWN expected = <<~HTML

footnotes

Let's render some footnotes1

  1. This is a footnote

HTML assert_equal expected, CommonMarker.render_html(md, :FOOTNOTES) end end