@@ -34,7 +34,7 @@ suite('HTML Link Detection', () => {
3434 test ( 'Link creation' , ( ) => {
3535 testLinkCreation ( 'http://model/1.html' , 'javascript:void;' , null ) ;
3636 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' ) ;
3838 testLinkCreation ( 'http://model/1.html' , 'file:///C:\\Alex\\src\\path\\to\\file.txt' , 'file:///C:\\Alex\\src\\path\\to\\file.txt' ) ;
3939 testLinkCreation ( 'http://model/1.html' , 'http://www.microsoft.com/' , 'http://www.microsoft.com/' ) ;
4040 testLinkCreation ( 'http://model/1.html' , 'https://www.microsoft.com/' , 'https://www.microsoft.com/' ) ;
@@ -46,7 +46,7 @@ suite('HTML Link Detection', () => {
4646
4747 testLinkCreation ( 'file:///C:/Alex/src/path/to/file.html' , 'javascript:void;' , null ) ;
4848 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' ) ;
5050 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' ) ;
5151 testLinkCreation ( 'file:///C:/Alex/src/path/to/file.html' , 'http://www.microsoft.com/' , 'http://www.microsoft.com/' ) ;
5252 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', () => {
8989 testLinkDetection ( '<blockquote cite="foo.png">' , [ { offset : 18 , length : 7 , target : 'file:///test/data/abc/foo.png' } ] ) ;
9090 testLinkDetection ( '<style src="styles.css?t=345">' , [ { offset : 12 , length : 16 , target : 'file:///test/data/abc/styles.css' } ] ) ;
9191 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' } ] ) ;
9293 } ) ;
9394
9495 test ( 'Local targets' , ( ) => {
9596 testLinkDetection ( '<body><h1 id="title"></h1><a href="#title"</a></body>' , [ { offset : 35 , length : 6 , target : 'file:///test/data/abc/test.html#1,14' } ] ) ;
9697 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' } ] ) ;
9799 } ) ;
98100
99101} ) ;
0 commit comments