Skip to content

Commit 1eb529a

Browse files
committed
Fix inlkine breaking in Safari. (mathjax/MathJax#3252)
1 parent 7733112 commit 1eb529a

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

ts/output/chtml/Wrapper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ CommonWrapper<
268268
const space = this.em(dimen);
269269
if (breakable && name === 'space') {
270270
const node = adaptor.node('mjx-break', SPACE[space] ? {size: SPACE[space]} :
271-
{style: `letter-spacing: ${this.em(dimen - 1)}`});
271+
{style: `letter-spacing: ${this.em(dimen - 1)}`}, [adaptor.text(' ')]);
272272
adaptor.insert(node, this.dom[i]);
273273
} else if (dimen) {
274274
if (SPACE[space]) {

ts/output/chtml/Wrappers/math.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ export const ChtmlMath = (function <N, T, D>(): ChtmlMathClass<N, T, D> {
128128
// For inline breakpoints, use a space that is 1em width, make it breakable,
129129
// and then set the letter-spacing to make the sace the proper size.
130130
//
131-
'mjx-container[jax="CHTML"] mjx-break::after': {
132-
content: '" "',
131+
'mjx-container[jax="CHTML"] mjx-break': {
133132
'white-space': 'normal',
133+
'line-height': '0',
134134
'font-family': 'MJX-BRK'
135135
},
136136
'mjx-break[size="0"]': {

ts/output/svg.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,14 @@ CommonOutputJax<
430430
const adaptor = this.adaptor;
431431
const space = LENGTHS.em(dimen);
432432
if (!forced) {
433-
adaptor.insert(adaptor.node('mjx-break', {prebreak: true}), nsvg);
433+
adaptor.insert(adaptor.node('mjx-break', {prebreak: true}, [adaptor.text(' ')]), nsvg);
434434
}
435435
adaptor.insert(
436436
adaptor.node(
437437
'mjx-break',
438438
!forced ? {newline: true} :
439-
SPACE[space] ? {size: SPACE[space]} : {style: `letter-spacing: ${LENGTHS.em(dimen - 1)}`}
439+
SPACE[space] ? {size: SPACE[space]} : {style: `letter-spacing: ${LENGTHS.em(dimen - 1)}`},
440+
[adaptor.text(' ')]
440441
),
441442
nsvg
442443
);

ts/output/svg/Wrappers/math.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ export const SvgMath = (function <N, T, D>(): SvgMathClass<N, T, D> {
111111
// For inline breakpoints, use a space that is 1em width, make it breakable,
112112
// and then set the letter-spacing to make the sace the proper size.
113113
//
114-
'mjx-container[jax="SVG"] mjx-break::after': {
115-
content: '" "',
114+
'mjx-container[jax="SVG"] mjx-break': {
116115
'white-space': 'normal',
117116
'line-height': '0',
118117
'font-family': 'MJX-ZERO'

0 commit comments

Comments
 (0)