In 2012, commit
39d1f3967be9d added special handling image elements,
and for Cite references. This inadvertently broke handling of sorting
for tables with colspanned cells, which have node = undefined in the
cache.
In 2013, commit
e203fdfc74f18 restored handling of node = undefined.
In 2015, commit
7a5f4e46d10ea made colspan expanded in the cache
just as rowspan was already. Thus making this code dead.
It's odd to see $(node) before this check, and even a call within
this conditional. This worked, as long way to return ''.
Change-Id: Ia823a3ec29371be39fab3d626ed8647ee469951b
return false;
}
+ /**
+ * @param {HTMLElement} node
+ * @return {string}
+ */
function getElementSortKey( node ) {
var $node = $( node ),
// Use data-sort-value attribute.
// like charAt, toLowerCase and split are expected.
return String( data );
}
- if ( !node ) {
- return $node.text();
- }
if ( node.tagName.toLowerCase() === 'img' ) {
return $node.attr( 'alt' ) || ''; // handle undefined alt
}