Core: Return empty array instead of null for parseHTML("")

Fixes gh-1997
Close gh-1998
This commit is contained in:
Timo Tijhof
2015-01-07 20:12:49 +00:00
committed by Timmy Willison
parent d7e5fcee51
commit 4116914dca
2 changed files with 11 additions and 6 deletions

View File

@@ -15,8 +15,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;