Skip to content

Commit a928e3e

Browse files
authored
Merge pull request #54 from mathjax/table-support
Add table support
2 parents 7101270 + 4e4ad55 commit a928e3e

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

mathjax2/legacy/jax/element/MmlNode.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
'isError',
1414
'multiline',
1515
'variantForm',
16-
'autoOP'
16+
'autoOP',
17+
'fnOP'
1718
];
1819
var RENAME = {
1920
texWithDelims: 'withDelims'

mathjax3-ts/output/chtml/Wrappers/mtable.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,18 @@ export class CHTMLmtable extends CHTMLWrapper {
8888
const attributes = this.node.attributes;
8989
const frame = attributes.get('frame') !== 'none';
9090
const lines = frame || attributes.get('columnlines') !== 'none' || attributes.get('rowlines') !== 'none';
91-
const fspacing = (lines ? this.convertLengths(this.getAttributeArray('framespacing')) : ['0', '0']);
91+
const fspacing = (lines ? this.convertLengths(this.getAttributeArray('framespacing')) : []);
9292
//
9393
// Pad the rows of the table, if needed
9494
// Then set the column and row attributes for alignment, spacing, and lines
9595
// Finally, add the frame, if needed
9696
//
9797
this.padRows();
9898
this.handleColumnAlign();
99-
this.handleColumnSpacing(lines, fspacing[0]);
99+
this.handleColumnSpacing(lines, fspacing[0] || '0');
100100
this.handleColumnLines();
101101
this.handleRowAlign();
102-
this.handleRowSpacing(lines, fspacing[1]);
102+
this.handleRowSpacing(lines, fspacing[1] || '0');
103103
this.handleRowLines();
104104
this.handleFrame(frame);
105105
}
@@ -129,16 +129,16 @@ export class CHTMLmtable extends CHTMLWrapper {
129129
const cSpace = this.convertLengths(this.getColumnAttributes('columnspacing')).slice(0, cMax);
130130
const rSpace = this.convertLengths(this.getRowAttributes('rowspacing')).slice(0, rMax);
131131
const frame = this.node.attributes.get('frame') !== 'none';
132-
const fSpace = (frame ? this.convertLengths(this.getAttributeArray('framespacing')) : ['0', '0']);
132+
const fSpace = (frame ? this.convertLengths(this.getAttributeArray('framespacing')) : []);
133133
const cLines = this.getColumnAttributes('columnlines').slice(0, cMax).map(x => (x === 'none' ? 0 : .07));
134134
const rLines = this.getColumnAttributes('rowlines').slice(0, cMax).map(x => (x === 'none' ? 0 : .07));
135135
const a = this.font.params.axis_height;
136136
const h = H.concat(D, rLines).reduce((a, b) => a + b) + (frame ? .14 : 0) +
137-
rSpace.map(x => parseFloat(x)).reduce((a, b) => a + b) + 2 * parseFloat(fSpace[1]);
137+
rSpace.map(x => parseFloat(x)).reduce((a, b) => a + b) + 2 * parseFloat(fSpace[1] || '0');
138138
bbox.h = h / 2 + a;
139139
bbox.d = h / 2 - a;
140140
bbox.w = W.concat(cLines).reduce((a, b) => a + b) +
141-
cSpace.map(x => parseFloat(x)).reduce((a, b) => a + b) + 2 * parseFloat(fSpace[1]);
141+
cSpace.map(x => parseFloat(x)).reduce((a, b) => a + b) + 2 * parseFloat(fSpace[1] || '0');
142142
}
143143

144144
/******************************************************************/
@@ -155,7 +155,7 @@ export class CHTMLmtable extends CHTMLWrapper {
155155
}
156156

157157
/*
158-
* Set the cell aligmentsbased on the table, row, or cell columnalign attributes
158+
* Set the cell aligments based on the table, row, or cell columnalign attributes
159159
*/
160160
protected handleColumnAlign() {
161161
const colAlign = this.getColumnAttributes('columnalign') || [];
@@ -318,7 +318,7 @@ export class CHTMLmtable extends CHTMLWrapper {
318318
}
319319

320320
/*
321-
* Add a frame to the mjx-itable, if needed
321+
* Add a frame to the mtable, if needed
322322
*/
323323
protected handleFrame(frame: boolean) {
324324
if (frame) {

0 commit comments

Comments
 (0)