Skip to content

Commit

Permalink
simply remove the header
Browse files Browse the repository at this point in the history
`header_ids: nil` is confusing, and is not what's being tested
  • Loading branch information
gjtorikian committed Nov 25, 2024
1 parent 1093826 commit 993178d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions test/footnotes_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
class FootnotesTest < Minitest::Test
def test_to_html
md = <<~MARKDOWN
# footnotes
Let's render some footnotes[^1]
[^1]: This is a footnote
MARKDOWN
expected = <<~HTML
<h1>footnotes</h1>
<p>Let's render some footnotes<sup class="footnote-ref"><a href="#fn-1" id="fnref-1" data-footnote-ref>1</a></sup></p>
<section class="footnotes" data-footnotes>
<ol>
Expand All @@ -22,6 +20,6 @@ def test_to_html
</section>
HTML

assert_equal(expected, Commonmarker.to_html(md, options: { extension: { header_ids: nil, footnotes: true } }))
assert_equal(expected, Commonmarker.to_html(md, options: { extension: { footnotes: true } }))
end
end
6 changes: 3 additions & 3 deletions test/frontmatter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ def test_frontmatter_does_not_interfere_with_codeblock
end

def test_frontmatter_custom_delimiter
md = "---\nyaml: true\nage: 42\n---\n# Title 1"
md = "---\nyaml: true\nage: 42\n---\nThis is some text"
expected = <<~HTML
<h1>Title 1</h1>
<p>This is some text</p>
HTML

assert_equal(expected, Commonmarker.to_html(md, options: { extension: { header_ids: nil, front_matter_delimiter: "---" } }))
assert_equal(expected, Commonmarker.to_html(md, options: { extension: { front_matter_delimiter: "---" } }))
end
end

0 comments on commit 993178d

Please sign in to comment.