mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 12:25:02 -05:00
Core: set the base href of the context in parseHTML
Fixes gh-2965 Close gh-3022
This commit is contained in:
@@ -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" );
|
||||
} );
|
||||
|
||||
if ( jQuery.support.createHTMLDocument ) {
|
||||
QUnit.asyncTest( "jQuery.parseHTML", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
Reference in New Issue
Block a user