Skip to content

Commit

Permalink
Math: use core textExtraction on cells. See #1098
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Dec 9, 2015
1 parent de4c3db commit 7f027e8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions js/widgets/widget-math.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7f027e8

Please sign in to comment.