mathjax.js 790 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. var MathJax = {
  2. tex: {
  3. inlineMath: [
  4. ['$', '$'],
  5. ['\\(', '\\)'],
  6. ],
  7. displayMath: [
  8. ['$$', '$$'],
  9. ['\\[', '\\]'],
  10. ],
  11. processEscapes: true
  12. },
  13. showMathMenu: false,
  14. showProcessingMessages: false,
  15. messageStyle: 'none',
  16. skipStartupTypeset: true, // disable initial rendering
  17. positionToHash: false,
  18. options: {
  19. ignoreHtmlClass: 'tex2jax-ignore'
  20. },
  21. loader: {
  22. paths: {mathjax: chrome.runtime.getURL('/vendor/mathjax/es5')},
  23. },
  24. startup: {
  25. typeset: false
  26. }
  27. }
  28. var mj = {
  29. loading: false,
  30. render: () => {
  31. if (mj.loading) {
  32. return
  33. }
  34. mj.loading = true
  35. var timeout = setInterval(() => {
  36. if (!!MathJax) {
  37. clearInterval(timeout)
  38. MathJax.typesetPromise()
  39. }
  40. }, 0)
  41. }
  42. }