Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Core: set the base href of the context in parseHTML
- Loading branch information
Showing
2 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1563,6 +1563,15 @@ QUnit.test( "jQuery.parseHTML", function( assert ) { | |
assert.ok( jQuery.parseHTML( "<#if><tr><p>This is a test.</p></tr><#/if>" ) || true, "Garbage input should not cause error" ); | ||
} ); | ||
|
||
QUnit.test( "jQuery.parseHTML(<a href>) - gh-2965", function( assert ) { | ||
assert.expect( 1 ); | ||
|
||
var html = "<a href='test.html'></a>", | ||
href = jQuery.parseHTML( html )[ 0 ].href; | ||
|
||
assert.ok( /\/test\.html$/.test( href ), "href is not lost after parsing anchor" ); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
gibson042
Member
|
||
} ); | ||
|
||
if ( jQuery.support.createHTMLDocument ) { | ||
QUnit.asyncTest( "jQuery.parseHTML", function( assert ) { | ||
assert.expect( 1 ); | ||
|
@timmywil @gibson042 I've just noticed that: shouldn't we test that the URL is absolute and not just that it contains
test.html
?