Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • M MathJax
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 304
    • Issues 304
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MathJax
  • MathJax
  • Issues
  • #2740
Closed
Open
Issue created Jul 20, 2021 by Administrator@rootContributor

v2.7.9 multiple typeset at the same time, only first call get expected output

Created by: littlee

Issue Summary

call MathJax.Hub.Typeset multiple times at the same time, only the first one call get expected output result

Steps to Reproduce:

HTML code

<!DOCTYPE html>
<html>
  <head>
    <title>Parcel Sandbox</title>
    <meta charset="UTF-8" />
    <script src="https://unpkg.com/mathjax@2.7.9/MathJax.js?config=TeX-AMS-MML_SVG"></script>
    <script>
      MathJax.Hub.Register.StartupHook("TeX Jax Ready", () => {
        console.log("????");

        setTimeout(() => {
          render(document.querySelector(".r1"));
          render(document.querySelector(".r2"));
        }, 1000);
      });

      function 

      function render(elem) {
        elem.innerHTML = "\\(\\triangle ABC\\)";
        MathJax.Hub.Typeset(elem, () => {
          console.log("typeset", elem);
        });
      }
    </script>
  </head>

  <body>
    <div id="app">
      <div class="r1"></div>
      <div class="r2"></div>
    </div>
  </body>
</html>

image

from the render result, we can see that .r1 has SVG output, but .r2 has HTML ouput

Technical details:

  • MathJax Version: 2.7.9
  • Client OS: macOS 11.4
  • Browser: Chrome 91.0.4472.114

Supporting information:

reproduce demo: https://codesandbox.io/s/nifty-swartz-18qpv?file=/index.html:0-771

Assignee
Assign to
Time tracking