mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Math: Remove math_prefix
content prior to parsing cell values
This commit is contained in:
parent
0686e554d8
commit
12cde473d3
@ -29,7 +29,15 @@
|
||||
.split(' ').join('.tsmath '),
|
||||
|
||||
processText : function( c, $cell ) {
|
||||
var txt = ts.getElementText( c, $cell, math.getCellIndex( $cell ) );
|
||||
var tmp,
|
||||
txt = ts.getElementText( c, $cell, math.getCellIndex( $cell ) ),
|
||||
prefix = c.widgetOptions.math_prefix;
|
||||
if ( /</.test( prefix ) ) {
|
||||
// prefix contains HTML; remove it & any text before using formatFloat
|
||||
tmp = $( '<div>' + prefix + '</div>' ).text()
|
||||
.replace(/\{content\}/g, '').trim();
|
||||
txt = txt.replace( tmp, '' );
|
||||
}
|
||||
txt = ts.formatFloat( txt.replace( /[^\w,. \-()]/g, '' ), c.table ) || 0;
|
||||
// isNaN('') => false
|
||||
return isNaN( txt ) ? 0 : txt;
|
||||
|
Loading…
Reference in New Issue
Block a user