MathJax-node icon indicating copy to clipboard operation
MathJax-node copied to clipboard

MathJax freezing and consuming 100% CPU

Open jagermesh opened this issue 5 years ago • 2 comments

MathJax become unresponsive and consuming 100% CPU on following LaTeX. Timeout setting does not help :(

const mathjax = require('mathjax-node');

mathjax.start();

equation = 'so\\ i\\ did\\ _{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{_{=-----------------------------------------------------------------------------------------------------------------------------------}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}9315';

mathjax.typeset(
  { math: equation
  , format: 'TeX'
  , svg: true
  , linebreaks: true
  , timeout: 10 * 1000
  }
, function (data) {
    console.log(data);
  }
);

Any ideas how to solve this?

jagermesh avatar Apr 10 '19 21:04 jagermesh

This appears to be a problem in the line-breaking algorithm. Can you turn that off for this example?

dpvc avatar Apr 24 '19 16:04 dpvc

Well, it's user generated content through Equation Editor, so I can't predict what would it be. And for big texts I need line breaks :(

jagermesh avatar May 02 '19 21:05 jagermesh