Skip to content
Browse files

num-html type detect/sorting works with multiline

Improved num-html sorting and type-detection to handle html tags that
span multiple lines.
  • Loading branch information...
1 parent da04311 commit 66089f05576a3a229d35df6ee5180d3fadd9a2da @netj netj committed Jan 20, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 sorting/num-html.js
  2. +1 −1 type-detection/num-html.js
View
2 sorting/num-html.js
@@ -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 );
},
View
2 type-detection/num-html.js
@@ -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-";

0 comments on commit 66089f0

Please sign in to comment.
Something went wrong with that request. Please try again.