Skip to content

Commit 67ad71e

Browse files
committed
add a failing test for non-english anchors
1 parent 60b8b85 commit 67ad71e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/html/pipeline/toc_filter_test.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# encoding: utf-8
12
require "test_helper"
23

34
class HTML::Pipeline::TableOfContentsFilterTest < Test::Unit::TestCase
@@ -42,6 +43,13 @@ def test_all_header_tags_are_found_when_adding_anchors
4243
doc = TocFilter.call(orig)
4344
assert_equal 6, doc.search('a').size
4445
end
45-
end
4646

47+
def test_anchors_with_non_english_stuff
48+
orig = %(<h1>日本語</h1>
49+
<h1>Русский</h1)
4750

51+
names = TocFilter.call(orig).search('a').map { |a| a['name'] }
52+
assert_includes "日本語", names
53+
assert_includes "Русский", names
54+
end
55+
end

0 commit comments

Comments
 (0)