@@ -24,48 +24,34 @@ def accept_document
2424 end
2525
2626 def accept_heading
27- links = '<span><a href="#label-Hello">¶</a></span>'
28- expected = "\n <h5 id=\" label-Hello\" >Hello#{ links } </h5>\n "
29-
30- assert_equal expected , @to . res . join
27+ assert_equal "\n <h5 id=\" label-Hello\" ><a href=\" #label-Hello\" >Hello</a></h5>\n " , @to . res . join
3128 end
3229
3330 def accept_heading_1
34- links = '<span><a href="#label-Hello">¶</a></span>'
35-
36- assert_equal "\n <h1 id=\" label-Hello\" >Hello#{ links } </h1>\n " , @to . res . join
31+ assert_equal "\n <h1 id=\" label-Hello\" ><a href=\" #label-Hello\" >Hello</a></h1>\n " , @to . res . join
3732 end
3833
3934 def accept_heading_2
40- links = '<span><a href="#label-Hello">¶</a></span>'
41-
42- assert_equal "\n <h2 id=\" label-Hello\" >Hello#{ links } </h2>\n " , @to . res . join
35+ assert_equal "\n <h2 id=\" label-Hello\" ><a href=\" #label-Hello\" >Hello</a></h2>\n " , @to . res . join
4336 end
4437
4538 def accept_heading_3
46- links = '<span><a href="#label-Hello">¶</a></span>'
47-
48- assert_equal "\n <h3 id=\" label-Hello\" >Hello#{ links } </h3>\n " , @to . res . join
39+ assert_equal "\n <h3 id=\" label-Hello\" ><a href=\" #label-Hello\" >Hello</a></h3>\n " , @to . res . join
4940 end
5041
5142 def accept_heading_4
52- links = '<span><a href="#label-Hello">¶</a></span>'
53-
54- assert_equal "\n <h4 id=\" label-Hello\" >Hello#{ links } </h4>\n " , @to . res . join
43+ assert_equal "\n <h4 id=\" label-Hello\" ><a href=\" #label-Hello\" >Hello</a></h4>\n " , @to . res . join
5544 end
5645
5746 def accept_heading_b
58- links = '<span><a href="#label-Hello">¶</a></span>'
5947 inner = "<strong>Hello</strong>"
6048
61- assert_equal "\n <h1 id=\" label-Hello\" ># {inner } #{ links } </h1>\n " ,
49+ assert_equal "\n <h1 id=\" label-Hello\" ><a href= \" #label-Hello \" > # {inner } </a> </h1>\n " ,
6250 @to . res . join
6351 end
6452
6553 def accept_heading_suppressed_crossref
66- links = '<span><a href="#label-Hello">¶</a></span>'
67-
68- assert_equal "\n <h1 id=\" label-Hello\" >Hello#{ links } </h1>\n " , @to . res . join
54+ assert_equal "\n <h1 id=\" label-Hello\" ><a href=\" #label-Hello\" >Hello</a></h1>\n " , @to . res . join
6955 end
7056
7157 def accept_list_end_bullet
@@ -341,9 +327,7 @@ def test_accept_heading_7
341327
342328 @to . accept_heading @RM ::Heading . new ( 7 , 'Hello' )
343329
344- links = '<span><a href="#label-Hello">¶</a></span>'
345-
346- assert_equal "\n <h6 id=\" label-Hello\" >Hello#{ links } </h6>\n " , @to . res . join
330+ assert_equal "\n <h6 id=\" label-Hello\" ><a href=\" #label-Hello\" >Hello</a></h6>\n " , @to . res . join
347331 end
348332
349333 def test_accept_heading_aref_class
@@ -352,9 +336,7 @@ def test_accept_heading_aref_class
352336
353337 @to . accept_heading head ( 1 , 'Hello' )
354338
355- links = '<span><a href="#class-Foo-label-Hello">¶</a></span>'
356-
357- assert_equal "\n <h1 id=\" class-Foo-label-Hello\" >Hello#{ links } </h1>\n " ,
339+ assert_equal "\n <h1 id=\" class-Foo-label-Hello\" ><a href=\" #class-Foo-label-Hello\" >Hello</a></h1>\n " ,
358340 @to . res . join
359341 end
360342
@@ -364,9 +346,7 @@ def test_accept_heading_aref_method
364346
365347 @to . accept_heading @RM ::Heading . new ( 1 , 'Hello' )
366348
367- links = '<span><a href="#method-i-foo-label-Hello">¶</a></span>'
368-
369- assert_equal "\n <h1 id=\" method-i-foo-label-Hello\" >Hello#{ links } </h1>\n " ,
349+ assert_equal "\n <h1 id=\" method-i-foo-label-Hello\" ><a href=\" #method-i-foo-label-Hello\" >Hello</a></h1>\n " ,
370350 @to . res . join
371351 end
372352
@@ -427,7 +407,7 @@ def test_accept_heading_output_decoration
427407
428408 @to . accept_heading @RM ::Heading . new ( 1 , 'Hello' )
429409
430- assert_equal "\n <h1>Hello<span>< a href=\" #label-Hello\" >¶ </a></span ></h1>\n " , @to . res . join
410+ assert_equal "\n <h1>< a href=\" #label-Hello\" >Hello </a></h1>\n " , @to . res . join
431411 end
432412
433413 def test_accept_heading_output_decoration_with_pipe
0 commit comments