mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Core: Return empty array instead of null for parseHTML("")
Fixes gh-1997 Close gh-1998 Conflicts: test/unit/core.js
This commit is contained in:
committed by
Timmy Willison
parent
30ace26c42
commit
61bb61279c
@@ -14,8 +14,8 @@ define([
|
||||
// defaults to document
|
||||
// keepScripts (optional): If true, will include scripts passed in the html string
|
||||
jQuery.parseHTML = function( data, context, keepScripts ) {
|
||||
if ( !data || typeof data !== "string" ) {
|
||||
return null;
|
||||
if ( typeof data !== "string" ) {
|
||||
return [];
|
||||
}
|
||||
if ( typeof context === "boolean" ) {
|
||||
keepScripts = context;
|
||||
|
||||
Reference in New Issue
Block a user