@@ -34,7 +34,7 @@ suite('HTML Link Detection', () => {
34
34
test ( 'Link creation' , ( ) => {
35
35
testLinkCreation ( 'http://model/1.html' , 'javascript:void;' , null ) ;
36
36
testLinkCreation ( 'http://model/1.html' , ' \tjavascript:alert(7);' , null ) ;
37
- testLinkCreation ( 'http://model/1.html' , ' #relative' , 'http://model/1.html#relative ' ) ;
37
+ testLinkCreation ( 'http://model/1.html' , ' #relative' , 'http://model/1.html' ) ;
38
38
testLinkCreation ( 'http://model/1.html' , 'file:///C:\\Alex\\src\\path\\to\\file.txt' , 'file:///C:\\Alex\\src\\path\\to\\file.txt' ) ;
39
39
testLinkCreation ( 'http://model/1.html' , 'http://www.microsoft.com/' , 'http://www.microsoft.com/' ) ;
40
40
testLinkCreation ( 'http://model/1.html' , 'https://www.microsoft.com/' , 'https://www.microsoft.com/' ) ;
@@ -46,7 +46,7 @@ suite('HTML Link Detection', () => {
46
46
47
47
testLinkCreation ( 'file:///C:/Alex/src/path/to/file.html' , 'javascript:void;' , null ) ;
48
48
testLinkCreation ( 'file:///C:/Alex/src/path/to/file.html' , ' \tjavascript:alert(7);' , null ) ;
49
- testLinkCreation ( 'file:///C:/Alex/src/path/to/file.html' , ' #relative' , 'file:///C:/Alex/src/path/to/file.html#relative ' ) ;
49
+ testLinkCreation ( 'file:///C:/Alex/src/path/to/file.html' , ' #relative' , 'file:///C:/Alex/src/path/to/file.html' ) ;
50
50
testLinkCreation ( 'file:///C:/Alex/src/path/to/file.html' , 'file:///C:\\Alex\\src\\path\\to\\file.txt' , 'file:///C:\\Alex\\src\\path\\to\\file.txt' ) ;
51
51
testLinkCreation ( 'file:///C:/Alex/src/path/to/file.html' , 'http://www.microsoft.com/' , 'http://www.microsoft.com/' ) ;
52
52
testLinkCreation ( 'file:///C:/Alex/src/path/to/file.html' , 'https://www.microsoft.com/' , 'https://www.microsoft.com/' ) ;
@@ -89,11 +89,13 @@ suite('HTML Link Detection', () => {
89
89
testLinkDetection ( '<blockquote cite="foo.png">' , [ { offset : 18 , length : 7 , target : 'file:///test/data/abc/foo.png' } ] ) ;
90
90
testLinkDetection ( '<style src="styles.css?t=345">' , [ { offset : 12 , length : 16 , target : 'file:///test/data/abc/styles.css' } ] ) ;
91
91
testLinkDetection ( '<a href="https://werkenvoor.be/nl/jobs?f%5B0%5D=activitydomains%3A115&f%5B1%5D=lang%3Anl">link</a>' , [ { offset : 9 , length : 79 , target : 'https://werkenvoor.be/nl/jobs?f%5B0%5D=activitydomains%3A115&f%5B1%5D=lang%3Anl' } ] ) ;
92
+ testLinkDetection ( '<a href="jobs.html?f=bar">link</a>' , [ { offset : 9 , length : 15 , target : 'file:///test/data/abc/jobs.html' } ] ) ;
92
93
} ) ;
93
94
94
95
test ( 'Local targets' , ( ) => {
95
96
testLinkDetection ( '<body><h1 id="title"></h1><a href="#title"</a></body>' , [ { offset : 35 , length : 6 , target : 'file:///test/data/abc/test.html#1,14' } ] ) ;
96
97
testLinkDetection ( '<body><h1 id="title"></h1><a href="file:///test/data/abc/test.html#title"</a></body>' , [ { offset : 35 , length : 37 , target : 'file:///test/data/abc/test.html#1,14' } ] ) ;
98
+ testLinkDetection ( '<body><h1 id="title"></h1><a href="#body"</a></body>' , [ { offset : 35 , length : 5 , target : 'file:///test/data/abc/test.html' } ] ) ;
97
99
} ) ;
98
100
99
101
} ) ;
0 commit comments