Math: use core textExtraction on cells. See #1098

This commit is contained in:
Rob Garrison 2015-12-09 13:37:52 -06:00
parent de4c3db1ad
commit 7f027e813c

View File

@ -29,10 +29,7 @@
'filterReset filterEnd ' ).split(' ').join('.tsmath '),
processText : function( c, $cell ) {
var txt = $cell.attr( c.textAttribute );
if ( typeof txt === 'undefined' ) {
txt = $cell[0].textContent || $cell.text();
}
var txt = ts.getElementText( c, $cell, math.getCellIndex( $cell ) );
txt = ts.formatFloat( txt.replace( /[^\w,. \-()]/g, '' ), c.table ) || 0;
// isNaN('') => false
return isNaN( txt ) ? 0 : txt;