num-html type detect/sorting works with multiline

Improved num-html sorting and type-detection to handle html tags that
span multiple lines.
pull/7/head
Jaeho Shin 12 years ago
parent da04311c95
commit 66089f0557

@ -11,7 +11,7 @@
jQuery.extend( jQuery.fn.dataTableExt.oSort, { jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"num-html-pre": function ( a ) { "num-html-pre": function ( a ) {
var x = a.replace( /<.*?>/g, "" ); var x = String(a).replace( /<[\s\S]*?>/g, "" );
return parseFloat( x ); return parseFloat( x );
}, },

@ -11,7 +11,7 @@
jQuery.fn.dataTableExt.aTypes.unshift( function ( sData ) jQuery.fn.dataTableExt.aTypes.unshift( function ( sData )
{ {
sData = typeof sData.replace == 'function' ? sData = typeof sData.replace == 'function' ?
sData.replace( /<.*?>/g, "" ) : sData; sData.replace( /<[\s\S]*?>/g, "" ) : sData;
sData = $.trim(sData); sData = $.trim(sData);
var sValidFirstChars = "0123456789-"; var sValidFirstChars = "0123456789-";

Loading…
Cancel
Save