Skip to content

Commit

Permalink
num-html type detect/sorting works with multiline
Browse files Browse the repository at this point in the history
Improved num-html sorting and type-detection to handle html tags that
span multiple lines.
  • Loading branch information
netj committed Jan 20, 2013
1 parent da04311 commit 66089f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sorting/num-html.js
Expand Up @@ -11,7 +11,7 @@

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

Expand Down
2 changes: 1 addition & 1 deletion type-detection/num-html.js
Expand Up @@ -11,7 +11,7 @@
jQuery.fn.dataTableExt.aTypes.unshift( function ( sData )
{
sData = typeof sData.replace == 'function' ?
sData.replace( /<.*?>/g, "" ) : sData;
sData.replace( /<[\s\S]*?>/g, "" ) : sData;
sData = $.trim(sData);

var sValidFirstChars = "0123456789-";
Expand Down

0 comments on commit 66089f0

Please sign in to comment.