Skip to content

Commit

Permalink
Make sure strechy character extenders have non-zero height in CHTML, …
Browse files Browse the repository at this point in the history
…so they are placed properly by Safari. mathjax/MathJax#2598
  • Loading branch information
dpvc committed Dec 30, 2020
1 parent b0ca062 commit 2ae2cd7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ts/output/chtml/FontData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ export class CHTMLFontData extends FontData<CHTMLCharOptions, CHTMLVariantData,
css.padding = this.padding(data, dw);
} else if (dw) {
css['padding-left'] = this.em0(dw);
} else {
css.padding = '.1em 0'; // for Safari
}
styles['mjx-stretchy-v' + c + ' mjx-' + part + ' mjx-c::before'] = css;
return data[0] + data[1];
Expand Down Expand Up @@ -364,6 +366,8 @@ export class CHTMLFontData extends FontData<CHTMLCharOptions, CHTMLVariantData,
const css: StyleData = {content: (options && options.c ? '"' + options.c + '"' : this.charContent(n))};
if (part !== 'ext' || force) {
css.padding = this.padding(data, 0, -data[2]);
} else {
css['padding-top'] = '1px'; // for Safari
}
styles['mjx-stretchy-h' + c + ' mjx-' + part + ' mjx-c::before'] = css;
}
Expand Down
2 changes: 1 addition & 1 deletion ts/output/chtml/Wrappers/mo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ CommonMoMixin<CHTMLConstructor<any, any, any>>(CHTMLWrapper) {
transform: 'scalex(500)'
},
'mjx-stretchy-h > mjx-ext > mjx-c': {
width: 0
width: '100%'
},
'mjx-stretchy-h > mjx-beg > mjx-c': {
'margin-right': '-.1em'
Expand Down

0 comments on commit 2ae2cd7

Please sign in to comment.