Skip to content

Commit

Permalink
Follow up to #591
Browse files Browse the repository at this point in the history
Add a test to ensure that the anchor is properly generated on the
HTML_TOC side as well and give proper credit.

:heart:
  • Loading branch information
robin850 committed Dec 25, 2016
1 parent cf2da0b commit a666af3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

* Rely on djb2 hashing generating anchors with non-ASCII chars.

*Alexey Kopytko*, *namusyaka*

* Added suppport for HTML 5 `details` and `summary` tags.

Fix issue [#578](https://github.com/vmg/redcarpet/issues/578).
Expand Down
4 changes: 3 additions & 1 deletion test/html_toc_render_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def setup
## A __nice__ subtitle
## Another one
### A sub-sub-title
### 見出し
Markdown
end

Expand All @@ -19,7 +20,7 @@ def test_simple_toc_render
assert output.end_with?("</ul>")

assert_equal 3, output.scan("<ul>").length
assert_equal 4, output.scan("<li>").length
assert_equal 5, output.scan("<li>").length
end

def test_granular_toc_render
Expand All @@ -39,6 +40,7 @@ def test_toc_heading_id
assert_match /a-nice-subtitle/, output
assert_match /another-one/, output
assert_match /a-sub-sub-title/, output
assert_match /part-37870bfa194139f/, output
end

def test_toc_heading_with_hyphen_and_equal
Expand Down

0 comments on commit a666af3

Please sign in to comment.