Skip to content

Commit da2c2a3

Browse files
committed
disable automatic line breaks to fix rendering issue
1 parent 6c74b2a commit da2c2a3

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/lib/svg_text_utils.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,18 @@ function texToSVG(_texString, _config, _callback) {
215215
if(MathJax.config.startup.output !== 'svg') {
216216
MathJax.config.startup.output = 'svg';
217217
}
218+
219+
// MathJax v4 enables automatic inline linebreaking by default,
220+
// which breaks a lot of our layout assumptions. Disabling it
221+
// gives behavior consistent with v3.
222+
if(MathJaxVersion === 4) {
223+
if(!MathJax.config.svg) {
224+
MathJax.config.svg = {};
225+
}
226+
MathJax.config.svg.linebreaks = Lib.extendFlat(
227+
{}, MathJax.config.svg.linebreaks, {inline: false}
228+
);
229+
}
218230
};
219231

220232
const initiateMathJax = function() {

0 commit comments

Comments
 (0)