@@ -24,17 +24,17 @@ describe('Anchors', () => {
24
24
25
25
it ( 'should add single anchor' , ( ) => {
26
26
expect ( transformYfm ( '## Test {#test1}\n' + '\n' + 'Content\n' ) ) . toBe (
27
- '<h2 id="test1"><a href="#test1" class="yfm-anchor" aria-hidden="true"></a>Test</h2>\n' +
27
+ '<h2 id="test1"><a href="#test1" class="yfm-anchor" aria-hidden="true" rel="nofollow" ></a>Test</h2>\n' +
28
28
'<p>Content</p>\n' ,
29
29
) ;
30
30
} ) ;
31
31
32
32
it ( 'should add multiple anchors' , ( ) => {
33
33
expect ( transformYfm ( '## Test {#test1} {#test2} {#test3}\n' + '\n' + 'Content\n' ) ) . toBe (
34
34
'<h2 id="test1">' +
35
- '<a id="test3" href="#test3" class="yfm-anchor" aria-hidden="true"></a>' +
36
- '<a id="test2" href="#test2" class="yfm-anchor" aria-hidden="true"></a>' +
37
- '<a href="#test1" class="yfm-anchor" aria-hidden="true"></a>Test</h2>\n' +
35
+ '<a id="test3" href="#test3" class="yfm-anchor" aria-hidden="true" rel="nofollow" ></a>' +
36
+ '<a id="test2" href="#test2" class="yfm-anchor" aria-hidden="true" rel="nofollow" ></a>' +
37
+ '<a href="#test1" class="yfm-anchor" aria-hidden="true" rel="nofollow" ></a>Test</h2>\n' +
38
38
'<p>Content</p>\n' ,
39
39
) ;
40
40
} ) ;
@@ -49,9 +49,9 @@ describe('Anchors', () => {
49
49
'{% include [test](./mocks/include-anchor.md) %}\n' ,
50
50
) ,
51
51
) . toBe (
52
- '<h2 id="test0"><a href="#test0" class="yfm-anchor" aria-hidden="true"></a>Test</h2>\n' +
52
+ '<h2 id="test0"><a href="#test0" class="yfm-anchor" aria-hidden="true" rel="nofollow" ></a>Test</h2>\n' +
53
53
'<p>Content before include</p>\n' +
54
- '<h1 id="test1"><a href="#test1" class="yfm-anchor" aria-hidden="true"></a>Title</h1>\n' +
54
+ '<h1 id="test1"><a href="#test1" class="yfm-anchor" aria-hidden="true" rel="nofollow" ></a>Title</h1>\n' +
55
55
'<p>Content</p>\n' ,
56
56
) ;
57
57
} ) ;
@@ -66,20 +66,20 @@ describe('Anchors', () => {
66
66
'{% include [test](./mocks/include-multiple-anchors.md) %}\n' ,
67
67
) ,
68
68
) . toBe (
69
- '<h2 id="test0"><a href="#test0" class="yfm-anchor" aria-hidden="true"></a>Test</h2>\n' +
69
+ '<h2 id="test0"><a href="#test0" class="yfm-anchor" aria-hidden="true" rel="nofollow" ></a>Test</h2>\n' +
70
70
'<p>Content before include</p>\n' +
71
71
'<h1 id="test1">' +
72
- '<a id="test3" href="#test3" class="yfm-anchor" aria-hidden="true"></a>' +
73
- '<a id="test2" href="#test2" class="yfm-anchor" aria-hidden="true"></a>' +
74
- '<a href="#test1" class="yfm-anchor" aria-hidden="true"></a>Title</h1>\n' +
72
+ '<a id="test3" href="#test3" class="yfm-anchor" aria-hidden="true" rel="nofollow" ></a>' +
73
+ '<a id="test2" href="#test2" class="yfm-anchor" aria-hidden="true" rel="nofollow" ></a>' +
74
+ '<a href="#test1" class="yfm-anchor" aria-hidden="true" rel="nofollow" ></a>Title</h1>\n' +
75
75
'<p>Content</p>\n' ,
76
76
) ;
77
77
} ) ;
78
78
79
79
it ( 'should be transliterated correctly' , ( ) => {
80
80
expect ( transformYfm ( '## Максимальный размер дисков \n' + '\n' + 'Content\n' ) ) . toBe (
81
81
'<h2 id="maksimalnyj-razmer-diskov">' +
82
- '<a href="#maksimalnyj-razmer-diskov" class="yfm-anchor" aria-hidden="true"></a>' +
82
+ '<a href="#maksimalnyj-razmer-diskov" class="yfm-anchor" aria-hidden="true" rel="nofollow" ></a>' +
83
83
'Максимальный размер дисков' +
84
84
'</h2>\n' +
85
85
'<p>Content</p>\n' ,
@@ -89,7 +89,7 @@ describe('Anchors', () => {
89
89
it ( 'should be removed fences after transliteration' , ( ) => {
90
90
expect ( transformYfm ( '## `Test`\n' + '\n' + 'Content\n' ) ) . toBe (
91
91
'<h2 id="test">' +
92
- '<a href="#test" class="yfm-anchor" aria-hidden="true"></a><code>Test</code>' +
92
+ '<a href="#test" class="yfm-anchor" aria-hidden="true" rel="nofollow" ></a><code>Test</code>' +
93
93
'</h2>\n' +
94
94
'<p>Content</p>\n' ,
95
95
) ;
@@ -106,7 +106,7 @@ describe('Anchors', () => {
106
106
) ,
107
107
) . toBe (
108
108
'<p>Content before include</p>\n' +
109
- '<h2 id="anchor"><a href="#anchor" class="yfm-anchor" aria-hidden="true"></a>Subtitle</h2>\n' +
109
+ '<h2 id="anchor"><a href="#anchor" class="yfm-anchor" aria-hidden="true" rel="nofollow" ></a>Subtitle</h2>\n' +
110
110
'<p>Subcontent</p>\n' +
111
111
'<p>After include</p>\n' ,
112
112
) ;
0 commit comments