Skip to content

Commit

Permalink
Fix inlkine breaking in Safari. (mathjax/MathJax#3252)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpvc committed Jul 2, 2024
1 parent 7733112 commit 1eb529a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ts/output/chtml/Wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ CommonWrapper<
const space = this.em(dimen);
if (breakable && name === 'space') {
const node = adaptor.node('mjx-break', SPACE[space] ? {size: SPACE[space]} :
{style: `letter-spacing: ${this.em(dimen - 1)}`});
{style: `letter-spacing: ${this.em(dimen - 1)}`}, [adaptor.text(' ')]);
adaptor.insert(node, this.dom[i]);
} else if (dimen) {
if (SPACE[space]) {
Expand Down
4 changes: 2 additions & 2 deletions ts/output/chtml/Wrappers/math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ export const ChtmlMath = (function <N, T, D>(): ChtmlMathClass<N, T, D> {
// For inline breakpoints, use a space that is 1em width, make it breakable,
// and then set the letter-spacing to make the sace the proper size.
//
'mjx-container[jax="CHTML"] mjx-break::after': {
content: '" "',
'mjx-container[jax="CHTML"] mjx-break': {
'white-space': 'normal',
'line-height': '0',
'font-family': 'MJX-BRK'
},
'mjx-break[size="0"]': {
Expand Down
5 changes: 3 additions & 2 deletions ts/output/svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,14 @@ CommonOutputJax<
const adaptor = this.adaptor;
const space = LENGTHS.em(dimen);
if (!forced) {
adaptor.insert(adaptor.node('mjx-break', {prebreak: true}), nsvg);
adaptor.insert(adaptor.node('mjx-break', {prebreak: true}, [adaptor.text(' ')]), nsvg);
}
adaptor.insert(
adaptor.node(
'mjx-break',
!forced ? {newline: true} :
SPACE[space] ? {size: SPACE[space]} : {style: `letter-spacing: ${LENGTHS.em(dimen - 1)}`}
SPACE[space] ? {size: SPACE[space]} : {style: `letter-spacing: ${LENGTHS.em(dimen - 1)}`},
[adaptor.text(' ')]
),
nsvg
);
Expand Down
3 changes: 1 addition & 2 deletions ts/output/svg/Wrappers/math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ export const SvgMath = (function <N, T, D>(): SvgMathClass<N, T, D> {
// For inline breakpoints, use a space that is 1em width, make it breakable,
// and then set the letter-spacing to make the sace the proper size.
//
'mjx-container[jax="SVG"] mjx-break::after': {
content: '" "',
'mjx-container[jax="SVG"] mjx-break': {
'white-space': 'normal',
'line-height': '0',
'font-family': 'MJX-ZERO'
Expand Down

0 comments on commit 1eb529a

Please sign in to comment.