Skip to content

Commit fa56810

Browse files
committed
Fix prettier issues
1 parent d8105bf commit fa56810

3 files changed

Lines changed: 54 additions & 22 deletions

File tree

ts/output/chtml.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,11 @@ export class CHTML<N, T, D> extends CommonOutputJax<
109109
'mjx-ms > mjx-c',
110110
'mjx-mtext > mjx-c',
111111
'mjx-stretchy-h',
112-
'mjx-stretchy-v'
113-
].join(', ')]:
114-
{
115-
'clip-path':
116-
'padding-box xywh(-1em -2px calc(100% + 2em) calc(100% + 4px))',
117-
},
112+
'mjx-stretchy-v',
113+
].join(', ')]: {
114+
'clip-path':
115+
'padding-box xywh(-1em -2px calc(100% + 2em) calc(100% + 4px))',
116+
},
118117

119118
'mjx-container[jax="CHTML"] :focus': { outline: 'solid 2px' },
120119
'mjx-container [space="1"]': { 'margin-left': '.111em' },

ts/output/chtml/FontData.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ export class ChtmlFontData extends FontData<
495495
//
496496
css['line-height'] = this.em0(h + d);
497497
styles[`mjx-stretchy-v${c} > mjx-${part} > mjx-spacer`] = {
498-
'margin-top': this.em(-d)
498+
'margin-top': this.em(-d),
499499
};
500500
}
501501
styles[`mjx-stretchy-v${c} > mjx-${part}`] = css;
@@ -549,7 +549,8 @@ export class ChtmlFontData extends FontData<
549549
`0 ${this.em0(We - 0.06)} 0 ${this.em0(Wb - 0.06)}`;
550550
}
551551
if (data.ext) {
552-
styles[`mjx-stretchy-h${c} > mjx-ext > mjx-spacer`]['letter-spacing'] = this.em(-data.ext);
552+
styles[`mjx-stretchy-h${c} > mjx-ext > mjx-spacer`]['letter-spacing'] =
553+
this.em(-data.ext);
553554
}
554555
}
555556

@@ -577,15 +578,15 @@ export class ChtmlFontData extends FontData<
577578
};
578579
if (part === 'ext') {
579580
if (w === 0 && options.dx) {
580-
w = 2 * options.dx - .06;
581+
w = 2 * options.dx - 0.06;
581582
}
582583
styles[`mjx-stretchy-h${c} > mjx-${part} > mjx-spacer`] = {
583-
'margin-left': this.em(-w / 2)
584+
'margin-left': this.em(-w / 2),
584585
};
585586
if (options.cmb) {
586587
styles[`mjx-stretchy-h${c} > mjx-${part} > mjx-c`] = {
587588
width: this.em(w),
588-
'text-align': 'right'
589+
'text-align': 'right',
589590
};
590591
}
591592
} else {

ts/output/chtml/Wrappers/mo.ts

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,14 @@ export const ChtmlMo = (function <N, T, D>(): ChtmlMoClass<N, T, D> {
270270
styles.height = this.em(h + d);
271271
styles.verticalAlign = this.em(-d);
272272
} else {
273-
this.createAssembly(parts, stretch, stretchv, content, w, delim.ext || 0);
273+
this.createAssembly(
274+
parts,
275+
stretch,
276+
stretchv,
277+
content,
278+
w,
279+
delim.ext || 0
280+
);
274281
styles.width = this.em(w);
275282
}
276283
//
@@ -314,22 +321,41 @@ export const ChtmlMo = (function <N, T, D>(): ChtmlMoClass<N, T, D> {
314321
//
315322
// Get the part width/heights (beginning, extender, end, middle)
316323
//
317-
const [ WHb, WHx, WHe, WHm ] =
318-
parts.map((part) => part ? (nl ? part[0] + part[1] : part[2] ): 0);
324+
const [WHb, WHx, WHe, WHm] = parts.map((part) =>
325+
part ? (nl ? part[0] + part[1] : part[2]) : 0
326+
);
319327
//
320328
// Get the extension width/heights (two when there is a middle piece)
321329
//
322-
const [ WH1, WH2 ] = parts[3]
323-
? [ (wh - WHm) / 2 - WHb, (wh - WHm) / 2 - WHe ]
324-
: [ wh - WHb - WHe, 0 ];
330+
const [WH1, WH2] = parts[3]
331+
? [(wh - WHm) / 2 - WHb, (wh - WHm) / 2 - WHe]
332+
: [wh - WHb - WHe, 0];
325333
//
326334
// Set up the beginning, extension, and end pieces
327335
//
328336
this.createPart('mjx-beg', parts[0], sn[0], sv[0], content);
329-
this.createPart('mjx-ext', parts[1], sn[1], sv[1], content, WH1, WHx - ext, nl);
337+
this.createPart(
338+
'mjx-ext',
339+
parts[1],
340+
sn[1],
341+
sv[1],
342+
content,
343+
WH1,
344+
WHx - ext,
345+
nl
346+
);
330347
if (parts[3]) {
331348
this.createPart('mjx-mid', parts[3], sn[3], sv[3], content);
332-
this.createPart('mjx-ext', parts[1], sn[1], sv[1], content, WH2, WHx - ext, nl);
349+
this.createPart(
350+
'mjx-ext',
351+
parts[1],
352+
sn[1],
353+
sv[1],
354+
content,
355+
WH2,
356+
WHx - ext,
357+
nl
358+
);
333359
}
334360
this.createPart('mjx-end', parts[2], sn[2], sv[2], content);
335361
}
@@ -363,10 +389,10 @@ export const ChtmlMo = (function <N, T, D>(): ChtmlMoClass<N, T, D> {
363389
const font =
364390
options.ff || (letter ? `${this.font.cssFontPrefix}-${letter}` : '');
365391
const c = options.c || String.fromCodePoint(n);
366-
let nodes = [] as (N|T)[];
392+
let nodes = [] as (N | T)[];
367393
if (part === 'mjx-ext' && (Wx || options.dx)) {
368394
if (!Wx) {
369-
Wx = 2 * options.dx - .06;
395+
Wx = 2 * options.dx - 0.06;
370396
}
371397
const n = Math.min(Math.ceil(W / Wx) + 1, 500);
372398
if (options.cmb) {
@@ -376,7 +402,13 @@ export const ChtmlMo = (function <N, T, D>(): ChtmlMoClass<N, T, D> {
376402
}
377403
} else {
378404
nodes = [
379-
this.html('mjx-spacer', {}, [this.text(Array(n).fill(c + nl).join(''))])
405+
this.html('mjx-spacer', {}, [
406+
this.text(
407+
Array(n)
408+
.fill(c + nl)
409+
.join('')
410+
),
411+
]),
380412
];
381413
}
382414
} else {

0 commit comments

Comments
 (0)